Link to home
Start Free TrialLog in
Avatar of WebStudioWest
WebStudioWestFlag for United States of America

asked on

CDO Email Authentication Problem

I'm trying to use the following script but it produces this error: Error 8004020f, line 24. This appears to mean it's not authenticating. Hosting tech support isn't much help. If someone has a similar script that works, I'll gladly give it a try. I just want to send a simple acknowledgment message when someone completes a form. Thanks, Gary


Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

'Authenticate if necessary
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"

'Outgoing SMTP server configuration
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.domain.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoSendUsingPort
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCon.Fields.Update

'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = "mail@domain.com" 'This has to be valid on the selected SMTP server
strSubject = "Email test"
strHTML = "This is a test"
objCDOSYSMail.To = "email@domain.com"
objCDOSYSMail.Subject = strSubject
objCDOSYSMail.HTMLBody = strHTML
objCDOSYSMail.Send

SOLUTION
Avatar of yehudaha
yehudaha
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Wadski
Wadski
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial