| 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 | |
| Member | Description |
|---|---|
| Answered | 1 Indicates that a message has been replied to. This flag is managed entirely by the IMAP client. |
| Deleted | 2 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. |
| Draft | 4 Indicates that the composition of a message has not been finished. This flag is managed entirely by the IMAP client. |
| Flagged | 8 Indicates that a message has been marked for special attention. This flag is managed entirely by the IMAP client. |
| None | 0 No flags. This is used when a Set is being performed with ImapFlagModifier.Replace to clear all flags from a message. |
| Recent | 16 Indicates that a message has arrived at the server since the last update. This flag is managed entirely by the IMAP server. |
| Seen | 32 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. |
The following example demonstrates using the Set method to change message flags.
| 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) ' 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(); | |
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.
System.Object
System.ValueType
System.Enum
Dart.PowerTCP.Mail.ImapFlags
Target Platforms: Microsoft .NET Framework 2.0