通过Yahoo发送邮件失败 [英] Sending mail through Yahoo fails

查看:185
本文介绍了通过Yahoo发送邮件失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2(假装)电子邮件地址 - 雅虎和Hotmail:
myyahoo@yahoo.com和myhotmail@hotmail.com(不是真实的)



我正在尝试从雅虎发送一封电子邮件到Hotmail。



基本上我尝试了其他几个电子邮件地址配置 - 所有这些都没有成功。



我已经挖了几天,下面的代码(从这里)应该工作,但它不会。

 '使用远程服务器发送电子邮件
Set Mail = CreateObject(CDO.Message)

'本节提供远程SMTP服务器的配置信息。

'使用网络发送消息(网络上的SMTP)。
Mail.Configuration.Fields.Item(http://schemas.microsoft.com/cdo/configuration/sendusing)= 2

Mail.Configuration.Fields.Item(http ://schemas.microsoft.com/cdo/configuration/smtpserver)=smtp.mail.yahoo.com
Mail.Configuration.Fields.Item(http://schemas.microsoft.com/cdo / configuration / smtpserverport)= 25

'为连接使用SSL(True或False)
Mail.Configuration.Fields.Item(http://schemas.microsoft.com/ cdo / configuration / smtpusessl)= False

Mail.Configuration.Fields.Item(http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout)= 60

'如果您的服务器需要外出身份验证,请取消注释下面的行,并使用有效的电子邮件地址和密码。
'基本(明文)身份验证
Mail.Configuration.Fields.Item(http://schemas.microsoft.com/cdo/configuration/smtpauthenticate)= 1
'您的SMTP服务器上的UserID
Mail.Configuration.Fields.Item(http://schemas.microsoft.com/cdo/configuration/sendusername)=myyahoo@yahoo.com
'邮件。 Configuration.Fields.Item(http://schemas.microsoft.com/cdo/configuration/sendpassword)=password

Mail.Configuration.Fields.Update

'远程SMTP服务器配置部分的结束部分

Mail.Subject =电子邮件主题
Mail.From =myyahoo@yahoo.com
Mail.To =myhotmail @ hotmail.com
Mail.TextBody =这是一封电子邮件。

Mail.Send
Set Mail = Nothing

错误消息是:


第32行

Char 1

错误服务器拒绝了发件人地址。服务器响应为530 5.7.1需要验证

代码8004020E

源(null)


在@Ansgar Wiechers的回复后,我修改了代码。
我绝对确定虚拟数据(xxxx)是有效的,但我仍然得到与上述相同的结果错误....

 code> Set Mail = CreateObject(CDO.Message)

Mail.Configuration.Fields.Item(http://schemas.microsoft.com/cdo/configuration/sendusing) = 2
Mail.Configuration.Fields.Item(http://schemas.microsoft.com/cdo/configuration/smtpserver)=smtp.mail.yahoo.com
Mail.Configuration。 Fields.Item(http://schemas.microsoft.com/cdo/configuration/smtpserverport)= 25
Mail.Configuration.Fields.Item(http://schemas.microsoft.com/cdo/configuration / smtpusessl)= False
Mail.Configuration.Fields.Item(http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout)= 60
Mail.Configuration.Fields.Item( http://schemas.microsoft.com/cdo/configuration/smtpauthenticate)= 1
Mail.Configuration.Fields.Item(http://schemas.microsoft.com/cdo/configuration/sendusername) =xxxx@yahoo.com
Mail.Configuration.Fields.Item( http://schemas.microsoft.com/cdo/configuration/sendpassword)=xxxx

Mail.Configuration.Fields.Update

Mail.Subject =电子邮件主题
Mail.From =xxxx@yahoo.com
Mail.To =xxxx@hotmail.com
Mail.TextBody =这是一封电子邮件。

Mail.Send
Set Mail = Nothing


解决方案

错误信息是不言自明的。远程服务器拒绝了您的消息,因为它没有正确验证:


错误服务器拒绝了发件人地址。服务器响应为530 5.7.1 需要验证


在您的代码中,提供密码的语句被注释out:

 '您的SMTP服务器上的UserID 
Mail.Configuration.Fields.Item(http:// schemas.microsoft.com/cdo/configuration/sendusername)=myyahoo@yahoo.com
'Mail.Configuration.Fields.Item(http://schemas.microsoft.com/cdo/配置/发送密码)=密码

所以您尝试使用您的邮箱地址和一个空的密码。取消注释该行,并确保密码正确。



此外,您可能需要启用SSL:

  Mail.Configuration.Fields.Item(http://sche...tion/smtpusessl)= True 

和/或将端口更改为465(smtps):

 邮件。 Configuration.Fields.Item(http://sche...tion/smtpserverport)= 465 

或587(提交):

  Mail.Configuration.Fields.Item(http://sche...tion/ smtpserverport)= 587 

取决于服务器提供的邮件提交方式。


I have 2 (pretend) email addresses - Yahoo and Hotmail: myyahoo@yahoo.com and myhotmail@hotmail.com (not real)

I am trying to send an email from Yahoo to Hotmail.

Basically I've tried several other email address configurations - all with no success.

I've been digging for a couple of days and the code below (modified from here) SHOULD work, but it doesn't.

'Sending an email using a remote server
Set Mail = CreateObject("CDO.Message")

'This section provides the configuration information for the remote SMTP server.

'Send the message using the network (SMTP over the network).
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.mail.yahoo.com"
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

'Use SSL for the connection (True or False)
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

'If your server requires outgoing authentication, uncomment the lines below and use a valid email address and password.
'Basic (clear-text) authentication
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'Your UserID on the SMTP server
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="myyahoo@yahoo.com"
'Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password"

Mail.Configuration.Fields.Update

'End of remote SMTP server configuration section

Mail.Subject="Email subject"
Mail.From="myyahoo@yahoo.com"
Mail.To="myhotmail@hotmail.com"
Mail.TextBody="This is an email message."

Mail.Send
Set Mail = Nothing

The error message is:

Line 32
Char 1
Error The server rejected the sender address. The server response was 530 5.7.1 Authentication required
Code 8004020E
Source (null)

After a response from @Ansgar Wiechers I have modified the code. I am absolutely sure that the dummy data (xxxx) is valid but I still get the same resulting error as above....

Set Mail = CreateObject("CDO.Message")

Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.mail.yahoo.com"
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="xxxx@yahoo.com"
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="xxxx"

Mail.Configuration.Fields.Update

Mail.Subject="Email subject"
Mail.From="xxxx@yahoo.com"
Mail.To="xxxx@hotmail.com"
Mail.TextBody="This is an email message."

Mail.Send
Set Mail = Nothing

解决方案

The error message is rather self-explanatory. The remote server rejected your message, because it didn't authenticate correctly:

Error The server rejected the sender address. The server response was 530 5.7.1 Authentication required

In your code the statement providing the password is commented out:

'Your UserID on the SMTP server
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="myyahoo@yahoo.com"
'Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password"

so you're trying to authenticate with your mail address and an empty password. Uncomment that line and make sure the password is correct.

Also, you may need to enable SSL:

Mail.Configuration.Fields.Item ("http://sche...tion/smtpusessl") = True

and/or change the port to 465 (smtps):

Mail.Configuration.Fields.Item ("http://sche...tion/smtpserverport") = 465

or 587 (submission):

Mail.Configuration.Fields.Item ("http://sche...tion/smtpserverport") = 587

depending on what way of mail submission the server provides.

这篇关于通过Yahoo发送邮件失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆