如何C#的Base64嵌入图片通过电子邮件发送? [英] How to c# Embed Base64 Image for Emailing?
问题描述
我目前使用的字符串通过EWS嵌入到电子邮件一个base64形象,但嵌入式图像不显示在我的Outlook客户端,当我收到的电子邮件。
I am currently using a string to embed a base64 image in email via EWS but the embeded images is not showing up in my outlook client when i receive the email.
如果我保存电子邮件源是在浏览器中查看
If i save the email source it is viewable in my browser.
static string str = @"<head><meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" /></head><body><img src=""data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="" /></body></html>";
是否有可能嵌入图像变成一个HTML电子邮件中这种方法吗?
Is it possible to embed images into a HTML email message in this method?
此致
克里斯
推荐答案
数据URI方案可能不会被接收方的支持:
的是什么样子的主要电子邮件客户端软件的数据URI支持?
Data URI scheme may be not supported by the receiving party: What is Data URI support like in major email client software?
考虑使用MIME相关(CID协议)发送HTML与嵌入式图像的电子邮件。我相信这是远远更好的支持。我不知道,如果它可以用的SmtpMail轻松完成。
Consider using MIME related (cid protocol) to send html email with embedded images. I believe it is far better supported. I'm not sure if it can be easily done with SmtpMail.
这篇关于如何C#的Base64嵌入图片通过电子邮件发送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!