MessageFlagAction Enumeration |
Namespace: MailBee.ImapMail
Member name | Value | Description | |
---|---|---|---|
Replace | 0 | The specified flags will replace the existing flags of the message. | |
Add | 1 | The specified flags will be added to the list of existing flags of the message. | |
Remove | 2 | The specified flags will be removed from the list existing flags of the message. | |
ReplaceGmailLabel | 3 | The specified Gmail labels will replace the existing Gmail labels of the message. | |
AddGmailLabel | 4 | The specified Gmail labels will be added to the list of existing Gmail labels of the message. | |
RemoveGmailLabel | 5 | The specified Gmail labels will be removed from the list existing Gmail labels of the message. |
It's not error to attempt to remove flags which are not set or add flags which are already set. The server will simply do nothing in this case. For instance, if the application sets "\Deleted" flag for two messages and the first message already has this flag set, the first message flags will remain intact while the second message will acquire the "\Deleted" flag.
To remove all flags from the message (including both system and server-specific flags), the developer should call SetMessageFlags(String, Boolean, String, MessageFlagAction, Boolean) method passing empty flags and specifying Replace as action parameter value.
Values with GmailLabel suffix allow for setting Gmail-specific labels instead of ordinary IMAP flags. To use this functionality, make sure your mail server is Gmail-compatible ("x-gm-ext-1" capability must be listed in GetExtensions results). Gmail labels can only be used as strings (not as SystemMessageFlags values) so that you must use SetMessageFlags(String, Boolean, String, MessageFlagAction, Boolean) overload to set them.