Skip to main content

How to send an email with CDONTS

01. <%
02. Dim objCDOMail
03. Set objCDOMail = Server.CreateObject(“CDONTS.NewMail“)04. objCDOMail.From = “fromEmail@fromDomain.com
05. objCDOMail.To = “toEmail@toDomain.com
06. objCDOMail.Cc = “ccEmail@ccDomain.com
07. objCDOMail.Bcc = “bcc@mailDomain.com
08. objCDOMail.Subject = “Subject”
09. objCDOMail.BodyFormat = 0
10. objCDOMail.MailFormat = 0
11. objCDOMail.Body = “MailBody”
12. objCDOMail.Importance = 1 
13. objCDOMail.Send
14. Set objCDOMail = Nothing
15. %> Explanation According to Line01. Open ASP tag
02. Declare a variable named objCDOMail
03. Create instance of Mailer control04. Set Mailer control properties and collection items05. Set Mailer control properties and collection items06. Set Mailer control properties and collection items07. Set Mailer control properties and collection items08. Set Mailer control properties and collection items09. Set Mailer control properties and collection items10. Set Mailer control properties and collection items11. Set Mailer control properties and collection items12. Set Mailer control properties and collection items13. Send Mail
14. Release resources
15. Close ASP tag

Leave a Reply