mic*_*ael 6 c# asp.net email gmail internet-explorer-8
我创建了一个C#Webform程序,用于在我的网页上向客户发送提醒电子邮件.
它在Outlook中运行良好.在FireFox上的Gmail中.
我刚刚发现(我不使用IE)在IE 8中的gmail中它不显示图像?
它只有一个X和alt文本.
我无法弄清楚为什么IE 8和gmail不会显示图像,我已经玩了一下.
在C#中:
LinkedResource emo2 = new LinkedResource(logoPath);
emo2.ContentId = "logo";
emo2.TransferEncoding = System.Net.Mime.TransferEncoding.Base64;
htmlView.LinkedResources.Add(emo2);
Run Code Online (Sandbox Code Playgroud)
在我的HTML文件中:
<img id="header" alt="MyWebpage" src="cid:logo" />
Run Code Online (Sandbox Code Playgroud)
通过电子邮件发送简报对所有不同的客户来说都是令人沮丧的.但我从没想过Gmail会成为我的问题!
尝试将其添加到 LinkedResource 的末尾:
logoPath, MediaTypeNames.Image.Jpeg);
Run Code Online (Sandbox Code Playgroud)
当然,假设您的徽标是 JPG!另外,是 htmlView 和 AlternateView 吗?