Images aren't being displayed as embedded in email sent by my application
Question
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.
Solution
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;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow