When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips

Sections:
Sample Chapters
Commonly Asked Message Board Questions
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
XML Info
Information:
Feedback
Author an Article
ASP ASP.NET ASP FAQs Message Board Feedback
Print this page.
Sending an Email with an Attachment
By Rob Taylor


Here is a simple example of sending an email with an attachment using CDONTS.

<%
  Option Explicit
 
  Dim objMail
  Set objMail = Server.CreateObject("CDONTS.NewMail")
 
     objMail.From = "friend@somewhere.com"
     objMail.Subject = "A message TO you"
     objMail.AttachFile("d:\images\pic.gif")
     objMail.To = "someone@someplace.com"
     objMail.Body = "This is the body of the Message"
     objMail.Send
 
 Response.write("Mail was Sent")
 
 'You must always do this with CDONTS.
  set objMail = nothing
%>

FAQ Table of Contents   A Simple CDONTS Example Sending a User's Feedback to the Webmaster in an Email 


ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article