在电子邮件中发送内联图像
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);
相关分类