This project is read-only.

Working with message flags

ImapX allows you to manage message flags. First of all, make sure the flags are downloaded.

Making sure the message flags are being requested

If you didn't make any changes to ImapClient.Behavior.MessageFetchMode or set it to MessageFetchMode.Tiny, MessageFetchMode.Minimal, MessageFetchMode.Basic or MessageFetchMode.Full, no changes are required.

Otherwise, you can configure the client to always download flags:

client.Behavior.MessageFetchMode = client.Behavior.MessageFetchMode | MessageFetchMode.Flags

Or download them separately when using Folder.Search, MessageCollection.Download or Message.Download methods:

/* .. folder = any folder .. */ 
/* .. message = any message .. */ 

message.Download(MessageFetchMode.Flags);

/ * .. or .. */

folder.Messages.Download(MessageFetchMode.Flags);

/* .. or .. */

folder.Search("ALL", MessageFetchMode.Flags);

Checking which flags are set

In order to check which flags are set, enumerate through the Message.Flags collection:

/* .. message = any message .. */  
message.Flags

To make it easier, you can use the predefined values of flags in ImapX.Flags.MessageFlags

Next

Last edited May 1, 2014 at 10:07 AM by pavel_azanov, version 1