我的应用程序发送的电子邮件中未嵌入图像

[英]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.

我正在尝试使用Indy通过delphi应用程序发送包含嵌入图像的电子邮件,但不知何故它无法正常工作。

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发送的电子邮件的内容进行了比较,所有内容都很好,但我可能会遗漏一些细节。

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

Gmail会将我的电子邮件的附件图像显示为普通附件,但它已正确设置为内联。

EDIT

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

使用TIdMessageBuilderHtml解决了它在第一次尝试时完美的工作。

1 个解决方案

#1


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

使用TIdMessageBuilderHtml解决了它在第一次尝试时完美的工作。

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;

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2009/04/03/a467c06376d9483b6db5ed1fcb0ca34c.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com