CDONTS or CDOSYS – What to C-DO?

As server technology advances, web developers gain access to better tools. This progress also means that as some components age, they become obsolete and are no longer supported. An example of this on Windows servers is CDONTS. Web developers primarily use CDONTS as a thin client for mailing web forms.

Microsoft already discontinued CDONTS on Windows 2000, Windows XP and Windows 2003 servers. Microsoft also recommends that any scripts using CDONTS be updated using the newer CDOSYS technology or JMAIL.

CDOSYS is the successor of CDONTS, an easy way to send emails from webpages. To test CDOSYS functionality, use the following code saved into a file with an .asp extension. CDOSYS is a built-in component in ASP, so using it from your ASP code takes no additional effort on your part:

Set objCDOSYSMail = Server.CreateObject("CDO.Message") 
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration") 

objCDOSYSCon.Fields("") = "" 
objCDOSYSCon.Fields("") = 25
objCDOSYSCon.Fields("") = 2
objCDOSYSCon.Fields("") = 60 

Set objCDOSYSMail.Configuration = objCDOSYSCon 
objCDOSYSMail.From = ""
objCDOSYSMail.To = ""
objCDOSYSMail.Subject = "This is my subject for my test message"
objCDOSYSMail.HTMLBody = "This is the body "

Set objCDOSYSMail = Nothing 
Set objCDOSYSCon = Nothing 

Your SMTP server information should always be “″ or “localhost”. Default SMTP port is 25. If you are having issues sending out using port 25, port 587 can be used as an alternative.

More information on exactly how CDOSYS functions can be found on Microsoft’s website or at

As an alternative to CDOSYS, you may use JMAIL. Below you can find the code that you need to save with a .asp extension:



'send email

Set JMail = Server.CreateObject("JMail.SMTPMail") 
JMail.ServerAddress = ""
JMail.Sender = ""
JMail.Subject = "Contact Email"
JMail.AddRecipient ""
JMail.ContentType = "text/html"

JMail.Body = Text
JMail.Priority = 1


Response.Write Text

Just as always SMTP server is “127.0.01″ or “localhost”. Default SMTP port is 25, but port 587 can be used as well.

Note: Please remember that if CDONTS scripts are not updated to either CDOSYS or JMAIL your pages may not work correctly or appear down.

Was this article helpful?

Yes (0)
No (0)

We're sorry you didn't find this article very helpful. Please help us improve it by leaving your feedback below.