在电子邮件中发送内联图像有问题通过电子邮件发送图像作为嵌入的图像在身体中。图像文件显示为附件,这是可以的,但内联图像部分只是显示为红色x。这是我到目前为止所拥有的LinkedResource inline = new LinkedResource(filePath);inline.ContentId = Guid.NewGuid().ToString();
MailMessage mail = new MailMessage();Attachment att = new Attachment(filePath);
att.ContentDisposition.Inline = true;mail.From = from_email;mail.To.Add(data.email);
mail.Subject = "Client: " + data.client_id + " Has Sent You A Screenshot";mail.Body = String.Format(
"<h3>Client: " + data.client_id + " Has Sent You A Screenshot</h3>" +
@"<img src=""cid:{0}"" />", inline.ContentId);mail.IsBodyHtml = true;mail.Attachments.Add(att);
3 回答
- 3 回答
- 0 关注
- 1007 浏览
添加回答
举报
0/150
提交
取消