Embed Image in HTML Email#
<%
Dim objNewMail, strHTML
'Creates HTML body
strHTML ="<html><body><p>Hello Zarqawi!,</p>"
strHTML = strHTML + "<p>Long time no see. I can't believe you are stealing copier sheets from Pentagon!"
strHTML = strHTML + "<p>V. Subhash<br>http://www.vsubhash.com</p>"
'Refers to an embedded image
strHTML = strHTML + "<img src='subhash.jpg'>"
strHTML = strHTML + "</body></html>"
'Creates CDONTS NewMail object
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
'Makes it an HTML e-mail
objNewMail.BodyFormat = CdoBodyFormatHTML
objNewMail.MailFormat = CdoMailFormatMime
'Specifies sender's e-mail address
objNewMail.From = "V. Subhash - GML <moralvolcano@yahoo.com>"
'Specifies recipient's e-mail address
objNewMail.To = "Al Zarqawi <zarqawi@basement.pentagon.mil>"
'Specifies subject line
objNewMail.Subject = "Re: Cheap office supplies"
'Embeds image subhash_pps.jpg as subhash.jpg
objNewMail.AttachURL Server.MapPath(".") & "\subhash_pps.jpg", "subhash.jpg"
'Specifies e-mail body
objNewMail.Body = strHTML
'Sends the e-mail
objNewMail.Send
Set objNewMail = Nothing
%>
Back To ASP
Add new attachment
Only authorized users are allowed to upload new attachments.
«
This page (revision-1) was last changed on 06-May-2009 14:51 by Hyve Support