How to send 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 =
13. objCDOMail.Send
14. Set objCDOMail = Nothing
15. %>
 
Explanation According to Line
01. Open ASP tag
02. Declare a variable named objCDOMail
03. Create instance of Mailer control
04. Set Mailer control properties and collection items
05. Set Mailer control properties and collection items
06. Set Mailer control properties and collection items
07. Set Mailer control properties and collection items
08. Set Mailer control properties and collection items
09. Set Mailer control properties and collection items
10. Set Mailer control properties and collection items
11. Set Mailer control properties and collection items
12. Set Mailer control properties and collection items
13. Send Mail
14. Release resources
15. Close ASP tag
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to use CDOSYS Email ?

  Use following code for CDOSYS Email componets. <% Set cdoConfig =...

How to use Dundas Upload ?

The following code demonstrates how to populate the Upload control's collections, save uploaded...

error:Include file not found

Cause: Mostly This error cause when the parent path of your domain does not enable....

How to increase ASP timeout ?

You can increase timeout time from the ASP script itself by using Server.ScriptTimeOut property...

error:'8004020f' in CDONTS

  This error cause when you use wrong mail server in CDONTS Email componets. You will...