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 24-May-2017 15:30 by Hyve Support
G’day (anonymous guest) My Prefs
  • View Page Source
  • This clear IPSec security association,
    clear ipsec sa peer X.X.X.X
    

All Pages

Page views: 2418

Private Tomcat

Linux

MySQL

Email

SQL Server

ASP

JSP

C#

Web Mail

Windows Plesk

Linux Plesk

PHP

Gaming

ASP.NET

Persits ASPUpload

Wiki Help

Referring Pages:
...nobody

JSPWiki v2.8.1