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




Represents the method used when modifying flags.

Syntax

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

Members

MemberDescription
Add1 Adds the specified flags to the message.
Remove2 Removes the specified flags from the message.
Replace3 Replace the specified flags on the message.

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 ImapFlagModifier enumeration represents the method used when modifying flags on the server. This type is used when calling the Mailbox.Set command to update one or more flags on messages, and it is used in combination with the ImapFlags enumeration.

Inheritance Hierarchy

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

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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