I am getting error, when I send a mail
error '8004020f'
/sis/mail.asp, line 168
Here my code.
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
There isn't enough information in your post to solve the problem, as Vogel612 said. However, by far the most likely cause is that the server
mail.dartconsulting.info
requires authentication, while you are trying to send without authentication.I have connected to this server from my local computer and it gave me
550 Authentication is required for relay
, so even if you're located on the same server there's a high likelihood that you also need to be authenticated.Please refer to this website: http://www.powerasp.net/content/new/sending_email_cdosys.asp (or do a Google search) on how to send email with CDO with authentication.
The system will produce an error '8004020f' on an invalid recipient email address.
In my case, the issue was related to an invalid email address with a space before the @ sign.
This work for me: http://www.powerasp.net/content/new/sending_email_cdosys.asp
Make send using as 1 instead of 2
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1