This method only marks the message for deletion. The message is
not actually deleted until the mailbox is expunged or another mailbox
is selected. This method will return an error if the current mailbox
is in read-only mode, such as if it was selected using the
ExamineMailbox method.
It is important to note that unlike the POP3 protocol, a message
that is marked for deletion is still accessible on the IMAP server
until the mailbox is expunged. This means, for example, that a
deleted message can still be retrieved using the GetMessage
method.
To determine if a message has been marked for deletion, use the
GetMessageFlags method and check if the IMAP_FLAG_DELETED bit
flag has been set. To list all of the deleted messages in the current
mailbox, use the GetDeletedMessages method.
To remove the deletion flag from the message, use the
UndeleteMessage method. To prevent all messages in the current
mailbox from being expunged, use the ReselectMailbox method to
reset the current mailbox state.