The SetMessageFlags method returns the message flags for
the specified message.
Parameters
nMessageId
Number of message to obtain the message flags for. This value
must be greater than zero. The first message in the mailbox is
message number one.
nMode
An unsigned integer value which specifies one of the following
modes which determines how the message flags are set:
Value
Description
IMAP_FLAGS_REPLACE
All message flags are replaced with the flags specified by
the dwMessageFlags parameter.
IMAP_FLAGS_ADD
The message flags specified by the dwMessageFlags
parameter will be set for the message. Message flags that have
been previously set will remain unmodified.
IMAP_FLAGS_REMOVE
The message flags specified by the dwMessageFlags
parameter will be removed from the message. Message flags that
are not specified will remain unmodified.
dwMessageFlags
An unsigned integer value which specifies one or more message
flags. This parameter is constructed by using a bitwise operator
with any of the following values:
Value
Description
IMAP_FLAG_ANSWERED
The message has been answered.
IMAP_FLAG_DELETED
The message has been marked for deletion.
IMAP_FLAG_DRAFT
The message has not been completed and is marked as a draft
copy.
IMAP_FLAG_URGENT
The message has been flagged for urgent or special
attention.
IMAP_FLAG_RECENT
The message has been added to the mailbox recently.
IMAP_FLAG_SEEN
The message has been read.
Return Value
If the method succeeds, it returns IMAP_RESULT_OK. If an error occurs,
the method returns IMAP_ERROR. To get extended error information,
call GetLastError.
Requirements
Minimum Desktop Platform: Windows 7 Service Pack 1 Minimum Server Platform: Windows Server 2008 R2 Service Pack 1 Header File: cstools12.h Import Library: csmapv12.lib