Re: Embedded Images in HTML Format idMEssages

Giganews Newsgroups
Subject: Re: Embedded Images in HTML Format idMEssages
Posted by:  Don (kingfi…@joesgarage.org)
Date: Sun, 19 Feb 2006

> Could anyone give me an example if it is possible to embed images in an
> HTML Format in an IdMessage.

Assuming Indy 10...

For inline attachments, you need to do the following:

* Set the src attribute for the HTML <IMG> tag to use  a content-identifer
like:

    <IMG SRC="CID:MyImage.jpg"/>

* Create the image attachment as "inline" using the previous attribute in
the ContentID property:

    AAttachment := TIdAttachmentFile.Create( AMsg.MessageParts,
'c:\temp\MyImage.jpg' );
    AAttachment.ContentID := 'MyImage.jpg';
    AAtachment.ContenDisposition := 'inline';

TIdMessage.ContentType has to reflect the correct "multipart/*" value for
your use of other TIdText message parts in the message.

hth...

Replies

None

In response to

Embedded Images in HTML Format idMEssages posted by Ivan Sammut on Sun, 19 Feb 2006