MessageFlags Property  

Returns one or more flags which identify characteristics of the current message.


object.MessageFlags [= flags ]


The MessageFlags property returns information about the currently selected message specified by the Message property. The value returned is one or more of the following bit flags:

Value  Constant Description
0 imapFlagNone No flags have been set for the current message
1 imapFlagAnswered The message has been answered
2 imapFlagDraft The message is a draft copy and has not been delivered
4 imapFlagUrgent The message has been flagged for urgent or special attention
8 imapFlagSeen The message has been read
256 imapFlagRecent The message has been added to the mailbox recently
512 imapFlagDeleted The message has been marked for deletion

Setting the MessageFlags property changes the flags for the currently selected message. Multiple bit flags can be combined using the bitwise Or operator. An application can test if a flag is set by using the bitwise And operator.

Data Type

Integer (Int32)


The following example demonstrates how to check the MessageFlags property to see if the message has been marked for deletion, and if it has, to clear the flag so that it will not be deleted when the mailbox is unselected:

If (ImapClient1.MessageFlags And imapFlagDeleted) <> 0 Then
    ImapClient1.MessageFlags = ImapClient1.MessageFlags And Not imapFlagDeleted
End If

See Also

Message Property, MessageCount Property, MessagePart Property, MessageParts Property, MessageSize Property, MessageUID Property, GetMessage Method