邮件中嵌入图片
Embed image in email using System.Net.Mail.AlternateView htmlView = AlternateView.CreateAlternateViewFromString("<img src='cid:Logo' >",null "text/html");
LinkedResource logo = new LinkedResource("Your file");
logo.ContentId = "Logo";
htmlView.LinkedResources.Add(ADSKlogo);
message.AlternateViews.Add(htmlView);
You can add multiple images in your mail, but you need add the cid: as the prefix in the src attribution in the img tag.logo.ContentId = "Logo";
htmlView.LinkedResources.Add(ADSKlogo);
message.AlternateViews.Add(htmlView);
No comments:
Post a Comment