我得到的错误,当我发送邮件
错误“8004020f”
/sis/mail.asp,线168
在这里我的代码。
Set cdoConfig = Server.CreateObject( "CDO.Configuration")
cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="mail.dartconsulting.info"
cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
cdoConfig.Fields.Update
Set cdoMessage = Server.CreateObject ("CDO.Message")
Set cdoMessage.Configuration = cdoConfig
cdoMessage.From = "darteam28@gmail.com"
cdoMessage.To=email
cdoMessage.Subject = "Your Password"
cdoMessage.HtmlBody = "<table><tr><td></td></tr>"&_
"<tr><td colspan=2>Please find below your password</td></tr>"&_
"<tr><td>Password : "&password&"</td></tr>"&_
"<tr><td>UserName : "&uid&"</td></tr>"&_
"<tr><td>EmailID : "&email&"</td></tr>"&_
"<tr><td colspan=2>Please login and confirm/change your emailid</td></tr><table>"
cdoMessage.Send
Set cdoMessage = Nothing
Set cdoConfig = Nothing
没有在您的文章,以解决问题的足够信息,如Vogel612说。 然而,迄今为止最有可能的原因是服务器mail.dartconsulting.info
需要身份验证,而你正在试图无需验证发送。
我从本地计算机连接到该服务器,它给了我550 Authentication is required for relay
,所以即使你所在的同一台服务器上有一个高的可能性,你还需要进行身份验证。
请参考以下网站: http://www.powerasp.net/content/new/sending_email_cdosys.asp (或做了谷歌搜索)关于如何使用CDO发送电子邮件身份验证。
这项工作对我来说: http://www.powerasp.net/content/new/sending_email_cdosys.asp
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
'This section provides the configuration information for the remote SMTP server.
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="remoteserver"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
ObjSendMail.Configuration.Fields.Update
'End remote SMTP server configuration section==
ObjSendMail.To = "test@test.com"
ObjSendMail.Subject = "this is the subject"
ObjSendMail.From = "someone@someone.net"
' we are sending a text email.. simply switch the comments around to send an html email instead
'ObjSendMail.HTMLBody = "this is the body"
ObjSendMail.TextBody = "this is the body"
ObjSendMail.Send
Set ObjSendMail = Nothing
请使用为1发送,而不是2
ObjSendMail.Configuration.Fields.Item( “ http://schemas.microsoft.com/cdo/configuration/sendusing ”)= 1
该系统将产生的无效收件人的电子邮件地址错误“8004020f”。
在我的情况下,问题涉及到一个无效的电子邮件地址为@符号前添加一个空格。