hi all,
I have a code which sends a form data to an external SMTP server, and it throws 8004020e error when I try to submit the form to send the email out. A search revealed that it may be issues with the SMTP configuration so I did a debug with telnet to the SMTP server directly using all the same data from the script and it works perfectly.
Does anyone have any guess why it's failing? I switched SMTP providers to try it out and also fails with the same error.
thanks
gyorgy
<%
mailtext="something"
Set NewMailObj=Server.CreateObject("CDO.Message")
NewMailObj.From = <from email>
NewMailObj.To = <to email>
NewMailObj.Subject = <subject>
NewMailObj.HTMLBody = mailtext
NewMailObj.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
NewMailObj.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = <smtp server>
NewMailObj.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
NewMailObj.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = false 'Use SSL for the connection (True or False)
NewMailObj.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
NewMailObj.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") =<username>
NewMailObj.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") =<password>
NewMailObj.Configuration.Fields.Update
NewMailObj.Send
Set NewMailObj = nothing
%>