Gets the size of the MIME part content in bytes.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax Public ReadOnly Property Size As Integer
Get
Property Value
Type:
Int32
A size of the MIME part of the message in bytes.
Return Value
Type:
Int32Remarks
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.
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
foreach (MimePart part in msg.MimePartTree.GetAllParts())
{
Console.WriteLine(part.Size.ToString());
}
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")
For Each part As MimePart In msg.MimePartTree.GetAllParts()
Console.WriteLine(part.Size.ToString())
Next
See Also