如何在邮件服务器上的HTML邮件中嵌入图像? [英] How to embed images in HTML email on the mail server?
问题描述
如何在HTML中嵌入图像,以便图像与html文件内容一起传递,不需要单独访问服务器来检索图像?在离开邮件服务器之前,我们需要将公司标志嵌入到签名中。我们不想使用像Thunderbird或Outlook的功能的客户端解决方案来添加签名。
How does one embedd an image in HTML so that the image is delivered with the html file content and does not need a separate trip to the server to retrieve the image? We need this to embed company logo's into signatures before they leave the mail server. We don't want to use a client side solution like thunderbird's or outlook's functionality to add signatures.
谢谢
推荐答案
您需要做的是将文件编码为Base64,并将其包含如下:
What you need to do is encode the file to Base64, and include it like this:
<img src="data:image/gif;base64,R0lGODlhUAA..(the rest of your base64 encoded file)..">
http://www.sweeting.org/mark/blog/2005/07/12/base64-encoded-images-embedded -in-html
http://dean.edwards.name/weblog/2005/06/base64-ie/
这篇关于如何在邮件服务器上的HTML邮件中嵌入图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!