AttachmentAsMimePart Property
Gets the attachment as MimePart object.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
public MimePart AsMimePart { get; }

Property Value

Type: MimePart
A MimePart object representing the attachment of the mail message as a MIME part.

MimePart corresponding to the given attachment provides access to those properties that are not available in Attachment but accessible in MimePart only.

To get the root part of the MIME parts tree of the message, use MimePartTree property of MailMessage object. MimePartTree MIME part contains all the MIME parts of the message.

This sample loads the message from .EML file and displays Content-Disposition of all attachments of this message. Content-Disposition value is not available in Attachment object but can be retrieved using MimePart object.
// 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();

// For every attachment...
foreach (Attachment attach in msg.Attachments)
    // the filename and content-disposition of the attachment.
    Console.WriteLine("Attachment name: " + attach.Filename);
    Console.WriteLine("Disposition: " + attach.AsMimePart.Disposition);
See Also