动态图像添加在电子邮件正文中 [英] Dynamic image add in email body

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

问题描述





我有html页面,其中包含一个div







i想在上面的div中添加动态图片路径,并通过c#发送到邮件。但背景图片没有显示在我的电子邮件中,我没有要求



我尝试了什么:



AlternateView View = default(AlternateView);

LinkedResource resource = default(LinkedResource);

View = AlternateView.CreateAlternateViewFromString(body,null ,text / html);

resource = new LinkedResource(HttpContext.Current.Server.MapPath(abc.png));

resource.ContentId = bodyimage;

resource.TransferEncoding = System.Net.Mime.TransferEncoding.Base64;

View.LinkedResources.Add(resource);

解决方案

检查此链接:





[ ^ ]

或者:如何在asp .net邮件发送中为电子邮件正文设置背景图像? [ ^ ]


我试过但不工作,不需要,要求:< div style =background-image: URL(CID:身体意象);>

Hi,

I have html page, which contain a div



i want to add dynamically image path in above div , and send to as mail by c#. But the background image is not showing in my email, i do not requries

What I have tried:

AlternateView View = default(AlternateView);
LinkedResource resource = default(LinkedResource);
View = AlternateView.CreateAlternateViewFromString(body, null, "text/html");
resource = new LinkedResource(HttpContext.Current.Server.MapPath("abc.png"));
resource.ContentId = "bodyimage";
resource.TransferEncoding = System.Net.Mime.TransferEncoding.Base64;
View.LinkedResources.Add(resource);

解决方案

Check this link:


[^]


or this: How to set background image for email body in asp .net mail sending?[^]


i tried but not working, not required ,require: <div style="background-image:url(cid:bodyimage);>


这篇关于动态图像添加在电子邮件正文中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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