Pop3GetMessageSizes Method |
Gets the array of lengths (in bytes) of all messages in the inbox. The array is zero-based.
Namespace: MailBee.Pop3MailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public int[] GetMessageSizes()
Public Function GetMessageSizes As Integer()
Return Value
Type:
Int32A zero-based array of lengths (in bytes) of all messages in the inbox, or a null reference (
Nothing in Visual Basic) in case of an error.
Exceptions Remarks Since the lower index in a .NET array is 0 while the lower message number in the inbox is 1,
indices in the lengths array are -1 to the message numbers.
Examples This sample displays the size in bytes of the first and the last message in the inbox.
using MailBee;
using MailBee.Pop3Mail;
Pop3 pop = new Pop3();
pop.Connect("mail.domain.com");
pop.Login("jdoe", "secret");
int[] lengths = pop.GetMessageSizes();
Console.WriteLine("Message #1 is the size of " + lengths[0] + " bytes");
Console.WriteLine("Message #" + pop.InboxMessageCount +
" is the size of " + lengths[pop.InboxMessageCount - 1] + " bytes");
pop.Disconnect();
Imports MailBee
Imports MailBee.Pop3Mail
Dim pop As New Pop3
pop.Connect("mail.domain.com")
pop.Login("jdoe", "secret")
Dim lengths As Integer() = pop.GetMessageSizes()
Console.WriteLine("Message #1 is the size of " & lengths(0) & " bytes")
Console.WriteLine("Message #" & pop.InboxMessageCount & _
" is the size of " & lengths(pop.InboxMessageCount - 1) & " bytes")
pop.Disconnect()
See Also