简体   繁体   English

电子邮件中的图像未显示

[英]Images in e-mail not showing up

The image is showing up in perfectly gmail but is blank in several other e-mail programs. 该图像显示为完美的gmail,但在其他几个电子邮件程序中为空白。 Not sure what's wrong. 不知道怎么了。 i have confirmed the actual links and have images turned on. 我已经确认了实际的链接并已打开图像。

<a target="_blank" href="https://site" style="display: block; height: 200px; width: 200px; margin-top: 4px; border: 0;">
<img src="https://image" alt="image" border="0" style="display: block; border:0;" />
</a>

Most email programs strip images out of emails since they can be used to track users. 大多数电子邮件程序都会将图像从电子邮件中删除,因为它们可用于跟踪用户。 This is particularly commonly done by spammers to verify active email addresses. 垃圾邮件发送者通常会这样做,以验证活动的电子邮件地址。 To work around this you can attach the images to the email itself. 要解决此问题,您可以将图像附加到电子邮件本身。

I would check to see if a non secure image using a regular http:// link works. 我将检查使用常规http://链接的不安全图像是否有效。 It is remotely possible a host machine or email application might be blocking port 443 used by SSL. 主机或电子邮件应用程序很可能会远程阻止SSL使用的端口443。 Since Gmail is cloud based, you would not have that problem. 由于Gmail基于云,因此您将不会遇到此问题。

I had a similar problem, and chose a rather radical workaround to avoid messing with the mail client's rules.. You can convert your image to a bitmap represented by a colored HTML table. 我遇到了类似的问题,因此选择了一种比较彻底的解决方法,以避免与邮件客户端的规则混淆。您可以将图像转换为彩色HTML表表示的位图。 The basic idea is quite simple, and you can find several tools that do that on the internet. 基本想法很简单,您可以在互联网上找到一些可以做到这一点的工具。 Of course with large bitmaps the resulting table could be hundreds of kilobytes long; 当然,使用大位图时,结果表的长度可能为数百KB。 when I had this problem I wrote a tool that applies some simple compression methods to that table, and released the code under GPL. 遇到此问题时,我编写了一个工具,该工具将一些简单的压缩方法应用于该表,并在GPL下发布了代码。

Might not be the cleanest solution but it works without too much compromise on the e-mail design. 可能不是最干净的解决方案,但它的工作原理没有对电子邮件的设计太多的妥协。

Tool for converting images to plain HTML with some compression 通过某种压缩将图像转换为纯HTML的工具

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM