经典的ASP,发送电子邮件错误“8004020f”(Classic ASP, Sending E-m

2019-10-18 18:08发布

我得到的错误,当我发送邮件

错误“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

Answer 1:

没有在您的文章,以解决问题的足够信息,如Vogel612说。 然而,迄今为止最有可能的原因是服务器mail.dartconsulting.info需要身份验证,而你正在试图无需验证发送。

我从本地计算机连接到该服务器,它给了我550 Authentication is required for relay ,所以即使你所在的同一台服务器上有一个高的可能性,你还需要进行身份验证。

请参考以下网站: http://www.powerasp.net/content/new/sending_email_cdosys.asp (或做了谷歌搜索)关于如何使用CDO发送电子邮件身份验证。



Answer 2:

这项工作对我来说: 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 


Answer 3:

请使用为1发送,而不是2

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



Answer 4:

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

在我的情况下,问题涉及到一个无效的电子邮件地址为@符号前添加一个空格。



文章来源: Classic ASP, Sending E-mail error '8004020f'
标签: asp-classic