Portal Home > Knowledgebase > VPS Hosting and Dedicated Servers > How to enable CDO.MESSAGE with MailEnable on Windows Server?


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.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Buy VPS with Skrill (Views: 6375)
Buy VPS with Darkcoin (Views: 6505)

* Minimum sign up periods for cPanel Web Hosting plans: Mini - 3mo., Pro - 1mo., Biz - 1mo., cPanel Reseller Hosting, Linux VPS, Windows VPS, Managed cPanel VPS and Dedicated Servers - 1mo. secret link
Accepted payments: Credit/Debit Card, Paypal, Payza, Skrill, WebMoney, CashU, Ukash, paysafecard, Bitcoin, Perfect Money, SolidTrust Pay, OKPay, EgoPay, Western Union/MG, Wire Transfer and more.