Facbook Pixel

How do I enable CDO.MESSAGE with MailEnable?

Some of the information in this article is advanced material we make available as a courtesy. Please be advised that you are responsible for properly following the procedures below. Customer Support cannot assist with these topics.

To send an email with Active Server Pages requires a component such as CDO.MESSAGE, which is supported on our Windows shared hosting servers.

To use MailEnable and CDOSYS at the same time you will need to change the Internet Information Services (IIS) SMTP port to port 8025 using the General tab in the SMTP virtual server properties dialog box. For more information on how to do this see Microsoft Windows Server Tech Center.

Next, you will need to add additional lines of code to the Code Snippet for CDO Messages.

Set objMail = Server.CreateObject("CDO.Message")
objMail.From = "YOUR FROM EMAIL ADDRESS"
objMail.To = "YOUR TO EMAIL ADDRESS"
objMail.Subject = "YOUR EMAIL SUBJECT LINE"
objMail.TextBody = "YOUR MESSAGE BODY"
objMail.Send

Set objMail = Nothing

Now, modify the Code Snippet for CDO Messages as follows.

sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = Server.CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "127.0.0.1" (add your smtp server address here)
.update
End With

Set objMail = Server.CreateObject("CDO.Message")
Set objMail.Configuration = cdoConfig
objMail.From = "YOUR FROM EMAIL ADDRESS"
objMail.To = "YOUR TO EMAIL ADDRESS"
objMail.Subject = "YOUR EMAIL SUBJECT LINE"
objMail.TextBody = "YOUR MESSAGE BODY"
objMail.Send

Set objMail = Nothing
Set cdoConfig = Nothing

For more information about CDOSYS, see MSDN.