read also RFC2557: http://www.ietf.org/rfc/rfc2557.txt
For handling inline images in email.
----
I've been playing around with the "data" URL scheme as proposed by RFC 2397 which states how to perform inline, bas64 encoded images. A number of browsers support this format from some of my tests and would be an interesting way of removing overhead from multiple HTTP connections. Basically, the IMG tag would be:
Something like that. Note also that I start the URI with "/-/" before the rest of the data scheme spec. If you don't start it with this, it won't work in a lot of the different browsers I tested (such as IE). Note this is useful for very small images only (as most browsers appear to have a limitation on the size of HTML element data of 1024). Browsers where this syntax worked that I tested are the following:
IE 6.x (windows)
Mozilla 0.97+ (linux)
Opera 5, 6 (windows)
Netscape 4.7+ (mac, windows)
IE 5 (macintosh)
This should work for other image types as well, such as PNG. JPEG files aren't really suggested (usually, these files are too large). BTW - there is no advantage to this method if the image will appear more than ONCE in the page because you will be transmitting the same data multiple times as opposed to just once (most browsers realize that already downloaded data that has multiple references only requires one HTTP call).
Consider using this method if you want to make a single PHP program that outputs both text and an image AND you want to make only on HTTP call. Cheers.
本文探讨了如何利用RFC2397提议的dataURL方案在HTML邮件中内联Base64编码的图片。这种方法在一些浏览器中有效,如IE6.x、Mozilla0.97+、Opera5,6和Netscape4.7+。适用于小尺寸图片,因为大多数浏览器对HTML元素数据大小有限制。通过这种方法,可以在只进行一次HTTP请求的情况下,由单一PHP程序同时输出文本和图像。
801

被折叠的 条评论
为什么被折叠?



