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

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

Property Value

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

Return Value

Type: Int32
Remarks
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.
Examples
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();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
foreach (MimePart part in msg.MimePartTree.GetAllParts())
{
    Console.WriteLine(part.Size.ToString());
}
See Also