MailMessageSize Property
Gets the size of the message 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
The size of the message in bytes.
If only the message headers were received from mail server, this property contains the size of these headers, but not of the entire message. To get the size of the entire message, use SizeOnServer property.
This sample downloads the message from the mail server (only the header and the first 10 lines of the body are downloaded) and checks if the message was received completely (and thus its body fits into 10 lines).
using System;
using MailBee;
using MailBee.Pop3Mail;
using MailBee.Mime;

class Sample
    static void Main(string[] args)
        // Download the first mail message from the specified POP3 account.
        MailMessage msg = Pop3.QuickDownloadMessage("", "jdoe", "password", 1, 10);

        if (msg.Size == msg.SizeOnServer)
            Console.WriteLine("The message was received completely");
            Console.WriteLine(@"The message was not received completely
                (maybe only the message headers were received)");

See Also