Click here to Skip to main content
Click here to Skip to main content

Send an email using ASP

, 25 Apr 2002
Rate this:
Please Sign up or sign in to vote.
Send email with CDONTS


This article shows how to send email from an ASP page using CDONTS Component.

Code snippet

Sub send_email(email_from, email_to, email_subject, email_body)
    Dim Newmail
    Set Newmail = server.CreateObject ("cdonts.newmail")
    Newmail.BodyFormat = 0
    Newmail.MailFormat = 0
    Newmail.From = email_from
    Newmail.To = email_to
    Newmail.Subject = email_subject
    Newmail.Body = email_body
    Set Newmail = Nothing    
End Sub

To call the procedure:
Call send_email("","","Subject","Body")
If you have any difficulty using CDONTS, it is most often the configuration of the SMTP service on IIS. There is not much that can go wrong with this simple, yet extremely powerful component.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Fernando Finelli
Web Developer
Argentina Argentina
Lic. Fernando Finelli

Comments and Discussions

QuestionTabs in ASP.NET Pinmemberrushdynet113-Mar-06 1:46 
QuestionHow to set IIS to support CDONTS Pinmemberalog200510-Nov-05 18:49 
Questionwhat I have to do PinmemberGreen Eyes24-Apr-05 3:08 
QuestionHow to configure IIS to enable smtp mail Pinmemberkarlim21-Jul-03 19:06 
AnswerRe: How to configure IIS to enable smtp mail Pinmemberaltafmalik19-Oct-03 13:50 
AnswerRe: How to configure IIS to enable smtp mail PinsussAnonymous19-Sep-04 22:37 
GeneralRe: How to configure IIS to enable smtp mail Pinmemberjuangsyj22-Mar-07 16:48 
GeneralRe: How to configure IIS to enable smtp mail Pinmemberdurga21223-Mar-07 22:24 
GeneralAre you going to post.... PinmemberAnonymous27-Apr-02 16:21 
GeneralRe: Are you going to post.... PinmemberFernando Finelli28-Apr-02 4:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150327.1 | Last Updated 26 Apr 2002
Article Copyright 2002 by Fernando Finelli
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid