Re: How to send an embedded image

Giganews Newsgroups
Subject: Re: How to send an embedded image
Posted by:  Remy Lebeau \(Indy Team\) (no.spam@no.spam.com)
Date: Mon, 9 Nov 2009

"Alexandre" <alexandrepires20…@yahoo.com.br> wrote in message
news:1DA9AAE8A497E340alexandrepires20…@yahoo.com.br...

> Remy, how to send an embedded image with TIdMessageBuilderHtml.

Use the HtmlFiles property, specifying a "cid:" URL in your HTML, ie:

with TIdMessageBuilderHtml.Create do
try
  HtmlCharSet := 'Utf-8';
  Html.Add('<IMG SRC="cid:mypicture.jpg">');
  HtmlFiles.Add('c:\mypicture.jpg');
  FillMessage(IdMsg);
finally
  Free;
end;

You can also specify your own unique IDs as desired:

with TIdMessageBuilderHtml.Create do
try
  HtmlCharSet := 'Utf-8';
  Html.Add('<IMG SRC="cid:mypictureid">');
  HtmlFiles.Add('c:\mypicture.jpg', 'mypictureid');
  FillMessage(IdMsg);
finally
  Free;
end;

--
Remy Lebeau (Indy Team)

Replies

None

In response to

How to send an embedded image posted by Alexandre on Sun, 8 Nov 2009