Gmail 中未显示 HTML 图像

2022-01-23 00:00:00 gmail html

我正在发送 HTML 格式的电子邮件通讯.在 HTML 里面我有类似的东西

I'm sending an e-mail newsletter in HTML. Inside the HTML I have something like

<img height='70' width='70' style='display:block' src='myDomain.com/imageName.png'>

当我使用 Thunderbird 或 Outlook 打开时事通讯时,图像正在显示.但是,当我使用 Gmail 打开它时,没有显示任何图像.我不确定这是否与 Gmail 出于安全原因使用的代理有关,还是其他原因.无论哪种方式,我都想知道是否有人遇到过这个问题,如果有,是如何解决的.

When I open the newsletter with Thunderbird or Outlook, the image is being displayed. However, when I open it with Gmail, no image is shown. I'm not sure if it's about the proxy that Gmail uses for security reasons or if it's something else. Either way, I'd like to know if anyone ever came across this and if so, how it was solved.

推荐答案

派对迟到了,但这里开始......我也遇到过这个问题,并通过以下方式解决:

Late to the party but here goes... I have experienced this problem as well and it was solved with the following:

  • 在 src url 中包含方案(使用//"不起作用 - 使用完整方案 EG:https://")
  • 包括宽度和高度属性
  • 包括 style="display:block" 属性
  • 同时包含 alt 和 title 属性

EG:

<img src="https://static.mydomain.com/images/logo.png" alt="Logo" title="Logo" style="display:block" width="200" height="87" />

相关文章