【发布时间】:2018-01-24 13:51:36
【问题描述】:
我正在尝试以 html 格式发送内联图像,它以 .bin 文件的形式出现
我已经阅读了这个问题的答案
Sending an e-mail with an image inline that is attached comes up as ATT00001 on some computers 但还是无法解决
string DexuslogoImage2 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Images\\DexusTenantNotice.png");
string strBody = strBody.Replace("##DexusNoticeLogo##", "cid:Dexuslogo1");
dynamic htmlView = AlternateView.CreateAlternateViewFromString(_Body.ToString(), null, "text/html");
if (!string.IsNullOrEmpty(_EmailLogo)) {
LinkedResource logo = new LinkedResource(_EmailLogo);
logo.ContentId = "Dexuslogo1";
htmlView.LinkedResources.Add(logo);
}
LinkedResource logo1 = new LinkedResource(_EmailLogo1);
logo1.ContentId = "Dexuslogo2";
htmlView.LinkedResources.Add(logo1);
aMessage.AlternateViews.Add(htmlView);
【问题讨论】:
-
你应该对前面的问题发表评论,看看 OP 是否找到了答案。
标签: outlook smtp html-email email-attachments inline-images