Html 主要电子邮件客户端软件中的数据 URI 支持是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6070196/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is Data URI support like in major email client software?
提问by joelhardi
Data URIsare a standard way to embed images and other binary data in HTML, and browser support is well documented on the web. (IE8 was the first version of IE to support Data URI, with a max 32 KB size per URI; other major browsers have supported it even longer.)
数据 URI是在 HTML 中嵌入图像和其他二进制数据的标准方法,并且浏览器支持在 Web 上有详细记录。(IE8 是第一个支持数据 URI 的 IE 版本,每个 URI 的最大大小为 32 KB;其他主要浏览器支持它的时间更长。)
My question is about desktop email and webmail client software.
我的问题是关于桌面电子邮件和网络邮件客户端软件。
When building HTML email, standard practice is either to include images as attachments or load them externally (i.e. tracking images). Both of these have disadvantages (some clients list all of these attached files, while many rightly block or require user action to see external images). So, Data URI looks like a good way to go, but only if it's supported by email readers.
构建 HTML 电子邮件时,标准做法是将图像作为附件包含或从外部加载(即跟踪图像)。这两者都有缺点(一些客户端列出了所有这些附加文件,而许多客户端正确地阻止或需要用户操作才能查看外部图像)。因此,数据 URI 看起来是一个不错的方法,但前提是电子邮件阅读器支持它。
So, does anyone have a link to a recent study of support for this feature? Or investigated this at all? For example, here's an overview of CSS support. Client software I'd be interested includes:
那么,有没有人提供最近有关此功能支持的研究的链接?或者根本没有调查过?例如,这里是 CSS 支持的概述。我感兴趣的客户端软件包括:
Desktop(including version info): Outlook, Apple Mail, Thunderbird, Evolution, Lotus Notes, AOL, Eudora
桌面(包括版本信息):Outlook、Apple Mail、Thunderbird、Evolution、Lotus Notes、AOL、Eudora
Webmail:Gmail, Live/Hotmail, Yahoo! Mail, AOL
网络邮件:Gmail、Live/Hotmail、Yahoo! 邮件,美国在线
Mobile:Android, iPhone
手机:安卓、iPhone
回答by Derek Ahmedzai
I've done a more recent test at Litmus, with data URIs for inline <img>
elements and css background images.
我最近在Litmus 上进行了一次测试,其中包含内联<img>
元素和 css 背景图像的数据 URI 。
These desktop clients doshow data URIs:
这些桌面客户端确实显示数据 URI:
- Apple Mail 5
- Apple Mail 6
- Lotus Notes 8
- Outlook 2003
- Thunderbird 3.0
- Thunderbird latest
- 苹果邮件 5
- 苹果邮件 6
- 莲花笔记 8
- 展望 2003
- 雷鸟 3.0
- 雷鸟最新
These mobile clients doshow data URIs:
这些移动客户端确实显示数据 URI:
- Android 2.3
- Android 4.0
- BlackBerry 5 OS
- iPad
- iPhone 3GS
- iPhone 4S
- iPhone 5
- 安卓 2.3
- 安卓 4.0
- 黑莓 5 操作系统
- iPad
- iPhone 3GS
- iPhone 4S
- iphone 5
None of the webmail clients showed data URIs.
没有一个 webmail 客户端显示数据 URI。
These desktop clients don't:
这些桌面客户端不会:
- Lotus Notes 6.5
- Lotus Notes 7
- Lotus Notes 8.5
- Outlook 2000
- Outlook 2002/XP
- Outlook 2007
- Outlook 2010
- Outlook 2011
- Outlook 2013
- 莲花笔记 6.5
- 莲花笔记 7
- 莲花笔记 8.5
- 展望 2000
- 展望 2002/XP
- 展望 2007
- 展望 2010
- 展望 2011
- 展望 2013
These mobile clients don't:
这些移动客户端不会:
- Gmail (Android)
- Outlook.com (Android)
- Yahoo (Android)
- BlackBerry 4 OS
- Symbian
- Windows Phone 7.5
- Gmail(安卓)
- Outlook.com (Android)
- 雅虎(安卓)
- 黑莓 4 操作系统
- 塞班
- 视窗电话 7.5
回答by James Roper
I just tested GMail, and it appears that GMail no longer supports data URIs.
我刚刚测试了 GMail,似乎 GMail 不再支持数据 URI。
In addition, gmx.de (a very popular German web mail provider) converts image URIs to a URI on its server, and this doesn't seem to support data URIs.
此外,gmx.de(一个非常流行的德国网络邮件提供商)在其服务器上将图像 URI 转换为 URI,这似乎不支持数据 URI。
回答by Dan Eden
Mac Mail, Outlook 2003 and MobileMe support data URIs. Not sure about the other clients, but you can easily find out — create a new message in Gmail, click 'insert image', then click 'use a URL' and paste in the data URI. Then, send it to a number of addresses and open it in the clients you want.
Mac Mail、Outlook 2003 和 MobileMe 支持数据 URI。不确定其他客户端,但您可以轻松找到 - 在 Gmail 中创建新邮件,点击“插入图片”,然后点击“使用 URL”并粘贴数据 URI。然后,将其发送到多个地址并在您想要的客户端中打开它。
回答by Steve Smith
I can't answer the question about the support for data-uri directly but support for anything like this is often very bad in email browsers. The issue really spans from many of them using their own cut down rendering engines that aren't full html renderers. In a system that it's still preferable to use a table based design to make sure emails are readable I wouldn't try to do anything clever.
我无法直接回答有关 data-uri 支持的问题,但在电子邮件浏览器中,对此类的支持通常非常糟糕。这个问题确实来自他们中的许多人使用他们自己的缩减渲染引擎,而不是完整的 html 渲染器。在一个仍然最好使用基于表格的设计来确保电子邮件可读的系统中,我不会尝试做任何聪明的事情。
However, you may already know that email allows two types of attachment. If you mark an attachment as inline then it tends not to show up in the list of attachments (though it often does).
但是,您可能已经知道电子邮件允许两种类型的附件。如果您将附件标记为内嵌,那么它往往不会出现在附件列表中(尽管它经常出现)。
I would think personally that ensuring the readability of the email is better than it not showing up and obviously the other approach of remote images doesn't help here.
我个人认为确保电子邮件的可读性比不显示要好,显然远程图像的其他方法在这里无济于事。