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




Represents the flags defined by IMAP.

Syntax

Visual Basic (Declaration) 
<FlagsAttribute()>
Public Enum ImapFlags 
   Inherits System.Enum
Visual Basic (Usage)Copy Code
Dim instance As ImapFlags
C# 
[FlagsAttribute()]
public enum ImapFlags : System.Enum 
Managed Extensions for C++ 
[FlagsAttribute()]
__value public enum ImapFlags : public System.Enum 
C++/CLI 
[FlagsAttribute()]
public enum class ImapFlags : public System.Enum 

Members

MemberDescription
Answered1 Indicates that a message has been replied to. This flag is managed entirely by the IMAP client.
Deleted2 Indicates that a message should be deleted when the next EXPUNGE operation occurs. This flag is managed entirely by the IMAP client, but it is used by the IMAP server during an EXPUNGE operation.
Draft4 Indicates that the composition of a message has not been finished. This flag is managed entirely by the IMAP client.
Flagged8 Indicates that a message has been marked for special attention. This flag is managed entirely by the IMAP client.
None0 No flags. This is used when a Set is being performed with ImapFlagModifier.Replace to clear all flags from a message.
Recent16 Indicates that a message has arrived at the server since the last update. This flag is managed entirely by the IMAP server.
Seen32 Indicates that a message has been read. This flag is managed both by the IMAP client and the IMAP server. Clients can update the flag, but the server does as well based on FETCH operations that occur.

Example

The following example demonstrates using the Set method to change message flags.
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)

' Add Flagged and Answered flags to messages 
Box.Set(First, Last, ImapFlagModifier.Add, ImapFlags.Flagged | ImapFlags.Answered)

' Refresh the mailbox.
Box.Refresh()

' Logout
Imap1.Logout()
C#Copy Code
// Login
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];

// Add Flagged and Answered flags to messages 
box.Set(first, last, ImapFlagModifier.Add, ImapFlags.Flagged | ImapFlags.Answered);

// Refresh the mailbox.
box.Refresh();

// Logout
imap1.Logout();

Remarks

The ImapFlags enumeration represents the flags defined by IMAP. These flags can be used with the Mailbox.Set command to update message flags on the server. These same server flags can be manipulated using the properties of the ImapMessage object (ex. Mailbox.Set command specifying an add of ImapFlags.Delete is equivalent to setting the ImapMessage.Delete property = true), although the use of Mailbox.Set command is more efficient for message groups.

Inheritance Hierarchy

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

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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