Changing Message Flags

The changeMessageFlags method of ImapClient allows changing message flags. The method takes 2 parameters:

  1. Message’s Sequence Number or Unique Id
  2. Message flag

The following flags can be set:

  • Answered
  • Deleted
  • Draft
  • Empty
  • Flagged
  • IsRead
  • Read
  • Recent

Set Message Flags

The code examples below show how to change message flags on an IMAP server with Aspose.Email.

Remove Message Flags

Message flags can also be removed with the removeMessageFlags method. Usage is similar to that of the changeMessageFlags method. It takes a sequence number or unique message ID and MessageFlag.

Setting Custom Flags

You can also set custom flags to a message using the ImapClient of the API. The ImapClient’s addMessageFlags provides the ability to set custom flags on messages.