To read the article online, visit http://www.4GuysFromRolla.com/webtech/faq/Email/faq3.shtml

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
%>


Article Information
Article Title: Sending an Email with an Attachment
Article Author: Scott Mitchell
Article URL: http://www.4GuysFromRolla.com/webtech/faq/Email/faq3.shtml


Copyright 2017 QuinStreet Inc. All Rights Reserved.
Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers