Embedded pictures in email with Indy10

Giganews Newsgroups
Subject: Embedded pictures in email with Indy10
Posted by:  Louis Valmeras (valmlou…@hotmail.com)
Date: Fri, 8 Apr 2011

I am trying to send an email with embedded pictures with Indy 10 components. I used the following code from Indy website:

TIdMessageBuilderHtml HtmlMessage = new TIdMessageBuilderHtml;

  try
  {
      HtmlMessage->Html->Assign(Memo->lines);
      HtmlMessage->HtmlFiles->Add('c:\folder\image1.jpg');
      HtmlMessage->HtmlFiles->Add('c:\folder\image2.jpg');
      HtmlMessage->FillMessage(IdMessage1);
  }
  __finally
  {
      delete HtlmMessage;
    }
The pictures appear attached but not embedded. I think it is because I didn't specify the pictures ID. This option was not available in the Indy version on which this example is based. The version of Indy 10.5.7 have this option. So, how to specify the pictures ID so that the pictures will be embedded?

Replies