Fabio Gomes
Fabio Gomes

Reputation: 6022

Images aren't being displayed as embedded in email sent by my application

I'm trying to send an email with embedded images through a delphi application using Indy, but somehow it isn't working.

I compared the contents of the email I sent with one sent from gmail, and everything seens fine, but I might be missing some little detail.

Gmail shows the attached image of my email as a normal attachment, but it is set correctly as inline.

EDIT

Solved using the TIdMessageBuilderHtml it worked perfectly on the first try.

Upvotes: 0

Views: 1677

Answers (1)

Fabio Gomes
Fabio Gomes

Reputation: 6022

Solved using the TIdMessageBuilderHtml it worked perfectly on the first try.

Just a few lines of code:

  with TIdMessageBuilderHtml.Create do
    try
      Subject := 'example';
      Html.Text := 'HTML goes here';
      HtmlFiles.Add('c:\folder\image1.jpg');
      HtmlFiles.Add('c:\folder\image2.jpg');
      FillMessage(IdMessage1);
    finally
      Free;
    end;

Upvotes: 5

Related Questions