How to enable CDO.MESSAGE with MailEnable on Windows Server?

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.

In order 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.

  • 42 Users Found This Useful
Was this answer helpful?

Related Articles

Change of the reverse DNS record for VPS hosting and dedicated server

To change the reverse DNS record for IP address, you’ll need to contact the support department in...

Checking of open connections

If you want to see the open connections to port 25 on your virtual private server or dedicated...

Do I have full root access to my VPS

Yes you do. With virtual hosting (VPS) you get root password for access, trough which you have...

Do I have my own IP address with my virtual server

Yes you do. We provide your own IP address to each virtual private server. If you need more than...

How to create .tar.gz archive

Creating .tar.gz archive can be done with one command. Use the following: tar -pczf...