Gets the size of the message 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
The size of the message in bytes.
Remarks
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.
Examples 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)
{
MailMessage msg = Pop3.QuickDownloadMessage("mail.domain.com", "jdoe", "password", 1, 10);
if (msg.Size == msg.SizeOnServer)
{
Console.WriteLine("The message was received completely");
}
else
{
Console.WriteLine(@"The message was not received completely
(maybe only the message headers were received)");
}
}
}
Imports System
Imports MailBee
Imports MailBee.Pop3Mail
Imports MailBee.Mime
Module Sample
Sub Main(ByVal args As String())
Dim msg As MailMessage = Pop3.QuickDownloadMessage("mail.domain.com", "jdoe", "password", 1, 10)
If msg.Size = msg.SizeOnServer Then
Console.WriteLine("The message was received completely")
Else
Console.WriteLine("The message was not received completely" & _
"(maybe only the message headers were received)")
End If
End Sub
End Module
See Also