CDONTS Sample Script

Please note that CDONTS has been deprecated and is available only on our Windows 2000 servers. If your site is hosted on a Windows 2003 or 2008 server please have a look at CDOSYS. Below is a simple CDONTS example written in ASP.

<%
  Dim objMail
  Set objMail = Server.CreateObject("CDONTS.NewMail")
     objMail.From = "yourname@yourdomain.com"
     objMail.Subject = "CDONTS Samples"
     objMail.To = "recipient@theirdomain.com"
     objMail.Body = "This is a sample message sent using CDONTS." 
     objMail.Send
  Response.write("Mail was Sent")
  'You must always do this with CDONTS.
  set objMail = nothing
%>

Modify the values above as appropriate then copy the code above into a file called cdontstest.asp on your site. When that's done go to http://www.yourdomain.com/cdontstest.asp If the test was successful the screen should show "Mail was Sent" and recipient@theirdomain.com should receive the email test.
 

Add Feedback