AttachmentContentID Property |
Namespace: MailBee.Mime
Each attachment which is referenced in the message body (e.g. a picture in HTML body) usually has a Content-ID header which is used to reference this attachment from the message body.
For instance, if the HTML body contains <IMG SRC="cid:picture1">, it's expected there is an attached image with Content-ID picture1. This image must be displayed in place of <IMG SRC="cid:picture1"> tag when the HTML body is being rendered.
Note |
---|
MailBee.NET has special features for displaying HTML body with embedded pictures. See SaveHtmlAndRelatedFiles(String) and GetHtmlAndSaveRelatedFiles methods for more information. |
// To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.Mime; // The actual code (put it into a method of your class) // Load the message from file. MailMessage msg = new MailMessage(); msg.LoadMessage(@"C:\Docs\TestMail.eml"); // For every attachment... foreach (Attachment attach in msg.Attachments) { // ...show the attachment identifier. Console.WriteLine("CID is " + attach.ContentID); }