在html控件中显示来自base64String的电子邮件中的图像 [英] show image in email from base64String in html control

查看:225
本文介绍了在html控件中显示来自base64String的电子邮件中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在向C#console应用程序的成员发送电子邮件。



我想在电子邮件中显示图片。我正在使用Base64String格式的图像。

我尝试使用以下代码,但它无法正常工作。图像未显示在电子邮件中 ​​-



Hi All,

I am sending an email to members from C# console application.

I want to show images in email. I am having the images in Base64String format.
I tryed with following code but it is not working. The image is not displaying in email-

image.src="data:image/jpeg;base64,"+imgData;





如何让它运作?



请建议。



提前感谢您的建议。



--Avinash



How to make it work?

Please suggest.

Thanks in advance for your suggessions.

--Avinash

推荐答案

您需要使用多部分电子邮件和特殊的 URI方案cid:。有关详细信息,请参阅我之前的回答:

发送带有图像的HTML附件 [ ^ ]。



另请参阅: http ://en.wikipedia.org/wiki/URI_scheme [ ^ ]。



-SA
You need to use multipart e-mail and the special URI scheme "cid:". For further detail, please see my past answer:
Sending HTML attachment with images[^].

See also: http://en.wikipedia.org/wiki/URI_scheme[^].

—SA


这篇关于在html控件中显示来自base64String的电子邮件中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆