Returns the size of the message in bytes.
Syntax
| Visual Basic (Declaration) | |
|---|
Public ReadOnly Property Size As Long |
| Visual Basic (Usage) | Copy Code |
|---|
Dim instance As MessageBase
Dim value As Long
value = instance.Size |
| C# | |
|---|
public long Size {get;} |
| Managed Extensions for C++ | |
|---|
public: __property long get_Size(); |
| C++/CLI | |
|---|
public:
property int64 Size {
int64 get();
} |
Property Value
An integer representing the size of the message in bytes.
Example
The following example demonstrates retrieving partial messages.
| Visual Basic | Copy Code |
|---|
' Login to the server
Imap1.Login(Server, User, Pass)
' Get the current mailbox in a short variable name so we don't have to type as much
Dim Box As Mailbox = Imap1.CurrentMailbox
Dim First As ImapMessage = Box.Messages(0)
Dim Last As ImapMessage = Box.Messages(box.Messages.Count - 1)
' Get all message headers and messages sizes
Box.Get(First, Last, ImapMessageSections.Header | ImapMessageSections.Size)
' Display Results.
Dim Msg as ImapMessage
For Each Msg in Box.Messages
Debug.WriteLine("Size: " + Msg.Size)
Debug.WriteLine("Subject: " + Msg.Message.Subject)
Next
' Logout
Imap1.Logout() |
| C# | Copy Code |
|---|
// Login to the server
imap1.Login(Server, User, Pass);
// Get the current mailbox in a short variable name so we don't have to type as much
Mailbox box = imap1.CurrentMailbox;
ImapMessage first = box.Messages[0];
ImapMessage last = box.Messages[box.Messages.Count - 1];
// Get all message headers and messages sizes
box.Get(first, last, ImapMessageSections.Header | ImapMessageSections.Size);
// Display Results.
foreach(ImapMessage msg in box.Messages)
{
Debug.WriteLine("Size: " + msg.Size);
Debug.WriteLine("Subject: " + msg.Message.Subject);
}
// Logout
imap1.Logout(); |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0
See Also