I am using a CDOSYS object to send emails via a script (for forum post notifications). All works fine, but occasionally I get the following error:
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
/send_mail.asp, line 141
Is there a way to catch the error, using on resume next? If so, how do I do this so that I get an error code but not to stop the script. (Function for sending the mail shown below.)
Thanks for any help you can offer,
Nathan
With objCDOSYSMail
'Who the e-mail is from
.From = """" & theWebsiteName & """ <" & theWebsiteEmailAddress & ">"""
'Who the e-mail is sent to
.To = """" & strToName & """ <" & strEmailAddress & ">"""
'The subject of the e-mail
.Subject = theSubject
'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)
If strMailFormat = "HTML" Then
.HTMLBody = theEmailBody & strAppendToEmail
Else
.TextBody = theEmailBody & strAppendToEmail
End If
'Send the e-mail
If NOT strMailServer = "" Then .Send
End with
PS I'm closing the oject each time.
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
/send_mail.asp, line 141
Is there a way to catch the error, using on resume next? If so, how do I do this so that I get an error code but not to stop the script. (Function for sending the mail shown below.)
Thanks for any help you can offer,
Nathan
With objCDOSYSMail
'Who the e-mail is from
.From = """" & theWebsiteName & """ <" & theWebsiteEmailAddress & ">"""
'Who the e-mail is sent to
.To = """" & strToName & """ <" & strEmailAddress & ">"""
'The subject of the e-mail
.Subject = theSubject
'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)
If strMailFormat = "HTML" Then
.HTMLBody = theEmailBody & strAppendToEmail
Else
.TextBody = theEmailBody & strAppendToEmail
End If
'Send the e-mail
If NOT strMailServer = "" Then .Send
End with
PS I'm closing the oject each time.