HTML Emails with ASP with embedded image attachments
page 1 of 1
Published: 04 Dec 2003
Unedited - Community Contributed
Abstract
How to send a HTML email, including how to attach an image or other object to the email and link to it from the message.
by Chris Garrett
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 7358/ 14

HTML Emails with ASP with embedded image attachments

HTML Emails with ASP with embedded image attachments
by Chris Garrett

This script will show you how to send a HTML email, but also it demonstrates the attachURL functionality which allows you attach an image or other object to the email and link to it from the message.

See it in action
http://authors.aspalliance.com/chrisg/tools/htmlemail.asp

View Source
http://authors.aspalliance.com/chrisg/tools/view-htmlemail.asp.asp

Download
http://authors.aspalliance.com/chrisg/tools/download.asp?file=htmlemail.asp

Lines 45 and 46 set the appropriate parameters to allow a HTML email. If you comment out line 50 then this will work fine for most HTML email requirements.

In the message body if you put in a reference to an image src ordinarily the client email program would have to connect to the URL to download it. If you use AttachURL as in line 50 you can tell the object that you want the file specified to be sent along with the text and any URL that references it should see that image.

I have asked several people on the ASP lists to test this out and for Microsoft Outlook readers the results are mixed when using AttachURL, from working fine through to seeing the source of the message. If in doubt, reference the full URL rather than using attachURL.

 



User Comments

Title: owner   
Name: dc
Date: 2009-09-28 3:53:08 PM
Comment:
link to source doesn't work
Title: Fixed the links   
Name: Brendan Enrick
Date: 2008-05-19 9:23:35 AM
Comment:
Ken,
I've fixed the links on this page so they all work now.
Title: HTML Emails with ASP with embedded image attachments   
Name: Ken
Date: 2008-05-14 9:59:16 AM
Comment:
Download link redirect does not work!
Title: Where is it then ???   
Name: kibble
Date: 2006-11-14 10:30:10 AM
Comment:
Where's the source code and examples?
Title: The resource you requested could not be located.   
Name: Sham Yemul
Date: 2006-06-30 3:18:39 AM
Comment:
Hello,

I am getting error The resource you requested could not be located. for all the three links.

I want the source code for this sample.

Regards
[Sham]
Title: HTML Emails with ASP with embedded image attachments   
Name: Vijaya
Date: 2006-03-02 1:18:45 AM
Comment:
Hi,
This code is not working.
It is working in your Action Page, But if i try separately not working.
It is displaying Page Cannot be Displayed.
The Error at AttachURL.
Bye
Thanks,
Vijaya
Title: Thank you   
Name: Aniz
Date: 2006-02-14 9:49:20 AM
Comment:
No, it is embedded image, see Message Source (in Outlook),
the message have this image as attachments not as link.
And i see it as embedded image.
Thank you very much !
Title: embedded image   
Name: Dewres
Date: 2006-02-06 2:25:05 PM
Comment:
This example don't demonstrate embedded image. It's just embedded link to a image hosted on a webserver.
Title: thanku   
Name: prateek
Date: 2005-05-24 2:38:06 AM
Comment:
1. can this code also run on XP.
2. what does CDO n CDONTS means

U really solved my problem

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 3:37:30 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search