1

当我发送邮件时出现错误

错误“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 :&nbsp;&nbsp;"&password&"</td></tr>"&_
                "<tr><td>UserName :&nbsp;&nbsp;"&uid&"</td></tr>"&_
                "<tr><td>EmailID :&nbsp;&nbsp;"&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
4

5 回答 5

4

正如 Vogel612 所说,您的帖子中没有足够的信息来解决问题。但是,到目前为止,最可能的原因是服务器mail.dartconsulting.info需要身份验证,而您却试图在没有身份验证的情况下发送。

我已从本地计算机连接到此服务器,它给了我550 Authentication is required for relay,因此即使您位于同一台服务器上,您也很可能需要进行身份验证。

请参阅此网站: https ://web.archive.org/web/20190905195123/http://www.powerasp.net/content/new/sending_email_cdosys.asp (或进行网络搜索)如何发送电子邮件具有身份验证的 CDO。

于 2013-10-10T11:16:25.533 回答
3

系统将在无效的收件人电子邮件地址上产生错误“8004020f” 。

就我而言,问题与@符号前带有空格的无效电子邮件地址有关。

于 2019-05-09T15:36:19.303 回答
0

对我来说,这个问题发生在我们开始从服务器发送批量电子邮件时。我通过将 smtpconnectiontimeout 从 60 增加到 180 来修复它。

我不知道这是否是一个好的做法,但希望得到反馈。

于 2022-01-19T08:58:32.980 回答
0

这项工作对我来说: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 
于 2015-07-15T19:34:08.713 回答
0

Make send using as 1 instead of 2

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1

于 2016-04-29T09:49:19.107 回答