Click here to Skip to main content
13,052,433 members (72,760 online)
Click here to Skip to main content
Add your own
alternative version


32 bookmarked
Posted 24 Apr 2002

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

You may also be interested in...


Comments and Discussions

QuestionTabs in ASP.NET Pin
rushdynet113-Mar-06 0:46
memberrushdynet113-Mar-06 0:46 
QuestionHow to set IIS to support CDONTS Pin
alog200510-Nov-05 17:49
memberalog200510-Nov-05 17:49 
Questionwhat I have to do Pin
Green Eyes24-Apr-05 2:08
memberGreen Eyes24-Apr-05 2:08 
QuestionHow to configure IIS to enable smtp mail Pin
karlim21-Jul-03 18:06
memberkarlim21-Jul-03 18:06 
AnswerRe: How to configure IIS to enable smtp mail Pin
altafmalik19-Oct-03 12:50
memberaltafmalik19-Oct-03 12:50 
AnswerRe: How to configure IIS to enable smtp mail Pin
Anonymous19-Sep-04 21:37
sussAnonymous19-Sep-04 21:37 
GeneralRe: How to configure IIS to enable smtp mail Pin
juangsyj22-Mar-07 15:48
memberjuangsyj22-Mar-07 15:48 
GeneralRe: How to configure IIS to enable smtp mail Pin
durga21223-Mar-07 21:24
memberdurga21223-Mar-07 21:24 
GeneralAre you going to post.... Pin
Anonymous27-Apr-02 15:21
memberAnonymous27-Apr-02 15:21 
GeneralRe: Are you going to post.... Pin
Fernando Finelli28-Apr-02 3:53
memberFernando Finelli28-Apr-02 3:53 

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

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

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