| Visual Basic (Declaration) | |
|---|---|
<FlagsAttribute()> Public Enum ImapMessageSections Inherits System.Enum | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As ImapMessageSections | |
| C# | |
|---|---|
[FlagsAttribute()] public enum ImapMessageSections : System.Enum | |
| Managed Extensions for C++ | |
|---|---|
[FlagsAttribute()] __value public enum ImapMessageSections : public System.Enum | |
| C++/CLI | |
|---|---|
[FlagsAttribute()] public enum class ImapMessageSections : public System.Enum | |
| Member | Description |
|---|---|
| Body | 1 Retrieve the entire message. |
| BodyStructure | 2 Retrieve the parsed structure of the body of the message. This is used in the ImapMessage.GetOutline method to retrieve the outline of the message without its content. |
| Date | 16 Retrieve the internal date of the message, indicating when it was received by the server. |
| Envelope | 4 Retrieve the message header, formatted in an IMAP specific fashion. |
| Flags | 8 Retrieve the message flags (ex. Answered, Delete, etc.). |
| Header | 32 Retrieve the headers for the message. |
| Size | 64 Retrieve the length of the encoded message, in bytes. |
| Text | 128 Retrieve the text of the message, if applicable. |
| Uid | 256 Retrieve the unique ID (UID) of the message. |
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(); | |
The ImapMessageSections enumeration represents the sections of an IMAP message. IMAP allows partial message retrieval, and this enumeration (whose values are additive) is used to indicate what sections of the message should be retrieved. One or more values from this enumeration can be passed to the Get method of either the ImapMessage and Mailbox objects.
System.Object
System.ValueType
System.Enum
Dart.PowerTCP.Mail.ImapMessageSections
Target Platforms: Microsoft .NET Framework 2.0