为什么我从SmtpClient发送的邮件中不会显示图像? [英] Why wont images show in the mail I send from SmtpClient?

查看:213
本文介绍了为什么我从SmtpClient发送的邮件中不会显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.

当我尝试使用带有图片的.net的SmtpClient创建html邮件并将其发送时,Outlook和gmail无法看到图像边框.

如果我在Outlook中将邮件另存为html文件,则可以轻松看到边框.
奇怪的是,主标题图像没有显示问题.

香港专业教育学院试图将图片的格式更改为gif或jpg,但是相同.我也尝试过跳过CSS,并在td´s中设置background属性,但这都不起作用.

您可以在此处查看html文件: http://14rs.dk/MailTest.htm [

Hi.

When I try to create a html mail with .net´s SmtpClient with pictures and send it, outlook and gmail cannot see the image borders.

If I in outlook save the mail as a html file, I can easily see the borders.
The weird thing is that the main header image has no problem being shown.

Ive tried change the format of the pictures to gif or jpg, but its the same. Ive also tried skipping css, and set the background attribute in the td´s, but that didnt work neither.

You can see the html file here: http://14rs.dk/MailTest.htm[^] (Its very simple!)

Hope you can help! Thanks alot :)

推荐答案

嘿,

您可以提供图像的完整网址(例如http://www.vadluri.com/images/img1.jpg).
您应该将图像上传到不在本地主机中的服务器中.

如果只需要图像边框
< img src ="img路径" border ="1" alt ="/>
Hey,

you can give complete url of the image (like http://www.vadluri.com/images/img1.jpg).
you should upload images into server not in localhost.

if you want only image border
<img src="img path" border="1" alt=""/>


这篇关于为什么我从SmtpClient发送的邮件中不会显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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