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.