About CDONTS
CDONTS allows you to send mail using the standard SMTP protocol from any program that can use ActiveX/OLE components. Features include:
- SMTP (sending) Messages
- Multiple File Attachments
- File attachments support MIME and UUEncoding
Simple Mail Example
Using the component is as simple as
- Creating the object
- Setting a few properties
- Calling the Send method
The following code demonstrates how to use CDONTS from VBScript. In this example Joe from Joe’s Widgets wishes to send an email to John Smith.
Set Mailer = Server.CreateObject("CDONTS.NewMail") NewMail.From = "Joe@somehost.com" NewMail.To = "jsmith@anotherhostname.com" NewMail.Subject = "Great SMTP Product!" NewMail.Body = "Dear Stephen" & VbCrLf & "Your widgets order has been processed!" if NewMail.Send then Response.Write "Mail sent..." else Response.Write "Mail send failure. Error was " & Mailer.Response end if
By testing the result of the Send method we can determine if the mailing process was successful or not.