PowerTCP Mail for .NET
ImapMessageSections Enumeration
Example  See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace : ImapMessageSections Enumeration




Represents the sections of an IMAP message when partial messages are retrieved.

Syntax

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 

Members

MemberDescription
Body1 Retrieve the entire message.
BodyStructure2 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.
Date16 Retrieve the internal date of the message, indicating when it was received by the server.
Envelope4 Retrieve the message header, formatted in an IMAP specific fashion.
Flags8 Retrieve the message flags (ex. Answered, Delete, etc.).
Header32 Retrieve the headers for the message.
Size64 Retrieve the length of the encoded message, in bytes.
Text128 Retrieve the text of the message, if applicable.
Uid256 Retrieve the unique ID (UID) of the message.

Example

The following example demonstrates retrieving partial messages.
Visual BasicCopy 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

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.

Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         Dart.PowerTCP.Mail.ImapMessageSections

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.