Frequently Asked Questions

Help Center Search

Using CDONTS to Send Email from Your Windows Shared Hosting Web Site

Print this Article
Comment on this Article
Last Updated: April 18, 2008 5:29 PM

CDONTS uses the NewMail object to create and send email. This method is incompatible with Windows shared hosting Web sites running IIS 7. The following ASP code sample demonstrates how to use CDONTS to create and send email:

<%
Dim MyBody
Dim MyCDONTSMail

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.From= "sender@coolexample.com"
MyCDONTSMail.To= "recipient@coolexample.com"
MyCDONTSMail.Subject="Subject"
MyBody = "Body"
MyCDONTSMail.Body= MyBody
MyCDONTSMail.Send

set MyCDONTSMail=nothing
%>