我正在尝试以 html 格式发送内联图像,它以 .bin 文件的形式出现
我已经阅读了这个问题的答案
发送带有内联图像的电子邮件在某些计算机上显示为 ATT00001, 但仍无法解决
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);