使用链接href在锚标记内的电子邮件中添加图像 [英] add image in email inside anchor tag with link href

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

问题描述

我可以在电子邮件附件中附加图片,但无法将图片附加到带有链接的锚标记内。



I am able to attach image in email attachment but unable to attach image inside anchor tag with link.

<a href='" + Url + "'><img src=cid:companylogo/></a>

<a href='http://Link'><img src=cid:companylogo/></a>

<a href="http://localhost:3560/Home/View/3">><img src=cid:companylogo/></a>

Link on > working but on attached image link not working. Interesting thing is both > and image are inside anchor tag.







Attachment imgattm = new Attachment(HttpContext.Current.Server.MapPath(@"/Content1/img/key-login-icon.png"));
                imgattm.ContentId = "companylogo";
                mail.Attachments.Add(imgattm);





以上代码发送图片附带电子邮件但href链接不起作用。



如果有人有想法请帮忙。



above code send image with attachment on email but href link not working.

if anyone have idea please help.

推荐答案

大多数电子邮件客户端都会阻止图片下载所以它不是你的代码错了,客户端电子邮件阻止了它。你无能为力。客户需要选择下载图像。
Most email clients will block image downloads so it isn't that your code is wrong, it's that the client email is blocking it. You can't do anything about that. The client needs to choose to download the image.


您好,



Hi,

.login {
  background: url(../img/user.png) no-repeat 6px center;
  width: 100px;
  height: 100px;
  display: block;
}







或者,






Or,

<a href="#" class="login" title="Login"><img src="../img/user.png" /></a>





点击链接有关详细信息:

http://www.createafreewebsite.net/anchor_tag_image.html [ ^ ]



谢谢,

-V



Follow the link for more details:
http://www.createafreewebsite.net/anchor_tag_image.html[^]

Thanks,
-V


这篇关于使用链接href在锚标记内的电子邮件中添加图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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