ASP 101 - Active Server Pages 101 - Web03
The Place ASP Developers Go!



Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash



 Top ASP 101 Stories Top ASP 101 Stories
Connections, Commands, And Procedures
What is ASP?
VBScript Classes: Part 1 of N

QUICK TIP:
Use <% OPTION EXPLICIT %>
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates


Quick Tips


Send Email from an ASP Page

Have you ever needed to send email from a web page? Perhaps to build a "Send this to a Friend" link? Have no fear, CDONTS is here. You can easily send email (and attachments!) with the Collaboration Data Objects for NT server. Note that this requires SMTP, which usually requires NT Server.

Letís assume youíve made a form for a user to fill out. Hereís the code for the email:

Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = Request.Form("From")
objMail.To = Request.Form("To")
objMail.CC = Request.Form("CC")
objMail.BCC = Request.Form("BCC")
objMail.Subject = Request.Form("Subject")
msgBody = "Dear Friend, this email is coming to you from CDONTS!"
objMail.Body = msgBody
objMail.Send
Set objMail = nothing

Thatís it! For more detailed information, check here.


Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to: webmaster@asp101.com.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers