ODBiC Discussion Board


using SENDMAIL to send HTML email with embedded images

by Ben Blundell, May 2, 2006 09:06

RE: sending HTML email with embedded images (as opposed to remotely linked ones).

In Outlook / Outlook Express / Thunderbird, when you select to insert an image into the email body, then it sets the image's src attribute to a special cid: link. This cid link is the same as the Content-ID header value sent for the image attachment.

e.g the code in the email body:

<img src="cid:777124215@02052006-2DE6">

Will display the following image attachment at that position

------_=_NextPart_001_01C66DFF.27F9C52A Content-Type: image/jpeg; name="nintendoDS.jpg" Content-Transfer-Encoding: base64 Content-ID: <777124215@02052006-2DE6> Content-Description: nintendoDS.jpg Content-Location: nintendoDS.jpg

/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAZAAA/+4ADkFkb2JlAGTAAAAAAf/b AIQAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgIC AwMDAwMDAwMDAwEBAQEBAQECAQECAgIBAgIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD AwMDAwMDAwMDAwMDAwMDAwMD/8AAEQgCmwH0AwERAAIRAQMRAf/EARUAAQACAgIDAQEAAAAAAAAA <.....more image data........>

I am trying to mimic this behaviour using the SENDMAIL command, but cannot figure out how to set the Content-ID header variable for image attachments. Can it be done?

Many Thanks

Ben Blundell



Replies:


Post Your Reply:

Name   
E-mail  optional
Topic  
Message:

HTTP Link: 
Link text: 

          


Copyright ©1997-2003, Roger Harris. All rights reserved.