CDO.Message.1 error '80040605' Unknown Error occurs when the HTMLBody is the first line of the code. In earlier versions of IIS, it was possible to run; however, with IIS 8 and Above, there seems to be a change that prevents this from working properly.
Issue Details
Sometimes when using CDOSYS to send email, you may run up on the following error.
CDO.Message.1 error '80040605' Unknown Error /Contact/mail.asp, line 62
myMail.To = "webmaster@domain.com"myMail.Subject = "This is your subject"myMail.From = "Visitor@Email.com"myMail.HTMLBody = "<strong>this is your first line here</strong>"myMail.HTMLBody = myMail.HTMLBody &"This is your second line"myMail.Send
As you can see in the above code, the 4th line is causing the error. Though we have been using the code this way for years, it seems that Microsoft has changed something, to where this will not longer function the way that it was or has in the past.
myMail.To = "webmaster@domain.com"myMail.Subject = "This is your subject"myMail.From = "Visitor@Email.com"myMail.TextBody = ""myMail.HTMLBody = myMail.HTMLBody &"<strong>this is your first line here</strong>"myMail.HTMLBody = myMail.HTMLBody &"This is your second line"myMail.Send
Looking at the 4th line now, you can see how we changed it from HTMLbody
Copy
Search Site
Search Google
to TextBody
Copy
Search Site
Search Google
. And we changed the original 1st line, to have the double HTMLBody, for the additional rows. This will allow the code to run properly now.
I assume that this is supposed to be, send text-based emails, in case HTML-based emails are not allowed or supported.