MimePartSize Property
Gets the size of the MIME part content in bytes.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public int Size { get; }

Property Value

Type: Int32
A size of the MIME part of the message in bytes.

Return Value

Type: Int32
This size includes the lengths of the header and body sections of the MIME part of the message. If the body was mail-transfer-encoded in the message, this size will reflect the size of the MIME part BEFORE decoding. This is different from Attachment.Size value which returns the size of the attachment body section AFTER decoding. Also, Attachment.Size does not count the header section.
This sample loads the message from .EML file and displays the size of all MIME parts.
// 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).
MailMessage msg = new MailMessage();
foreach (MimePart part in msg.MimePartTree.GetAllParts())
See Also