Working with messages

Starting from version, ImapX allows you to choose the way how messages are being requested. You can set the download mode globally or individually for a search or a single message.

Setting the global message download mode.

By default, the global download mode is set to Basic. This requests flags, headers, body structure, size, internal date and the message body (excluding embedded images and attachments).

/* .. Init client, authenticate .. */          
client.Behavior.MessageFetchMode = MessageFetchMode.Basic

Out of the box there are four predefined download modes:

// Request flags, headers and the body structure

// Request flags, headers, body structure, size and internal date

// Request flags, headers, body structure and body, size and internal date

// Request flags, headers, body and attachments, size and internal date

If you want to make it more individual, you can build your own bit mask:

// Request basic information and GMail mesage id, labels and thread id
client.Behavior.MessageFetchMode = MessageFetchMode.Basic |  MessageFetchMode.GMailExtendedData