WebStudioWest
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.M essage")
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.Configuratio n = 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
Set objCDOSYSMail = Server.CreateObject("CDO.M
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.Configuratio
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.