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

Introduction

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
    Newmail.Send
    
    Set Newmail = Nothing    
End Sub

To call the procedure:
Call send_email("from@domain.com","to@domain.com","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.

License

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

Share

About the Author

Fernando Finelli
Web Developer
Argentina Argentina
Lic. Fernando Finelli

Comments and Discussions

 
QuestionTabs in ASP.NET Pinmemberrushdynet113-Mar-06 0:46 
QuestionHow to set IIS to support CDONTS Pinmemberalog200510-Nov-05 17:49 
Questionwhat I have to do PinmemberGreen Eyes24-Apr-05 2:08 
QuestionHow to configure IIS to enable smtp mail Pinmemberkarlim21-Jul-03 18:06 
AnswerRe: How to configure IIS to enable smtp mail Pinmemberaltafmalik19-Oct-03 12:50 
AnswerRe: How to configure IIS to enable smtp mail PinsussAnonymous19-Sep-04 21:37 
GeneralRe: How to configure IIS to enable smtp mail Pinmemberjuangsyj22-Mar-07 15:48 
GeneralRe: How to configure IIS to enable smtp mail Pinmemberdurga21223-Mar-07 21:24 
GeneralAre you going to post.... PinmemberAnonymous27-Apr-02 15:21 
GeneralRe: Are you going to post.... PinmemberFernando Finelli28-Apr-02 3: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 | Mobile
Web04 | 2.8.141022.2 | Last Updated 26 Apr 2002
Article Copyright 2002 by Fernando Finelli
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid