This method supports unique IDs instead of message numbers. See
{@link ezcMailImapTransportOptions} for how to enable unique IDs
referencing.
$messages can be:
- a single message number (eg. 1)
- a message range (eg. 1:4)
- a message list (eg. 1,2,4)
$flag can be one of:
- ANSWERED - message has been answered
- DELETED - message is marked to be deleted by later EXPUNGE
- DRAFT - message is marked as a draft
- FLAGGED - message is "flagged" for urgent/special attention
- SEEN - message has been read
This function automatically adds the '\' in front of the flag when
calling the server command.
Before calling this method, a connection to the IMAP server must be
established and a user must be authenticated successfully, and a mailbox
must be selected.
Example:
$imap = new ezcMailImapTransport( 'imap.example.com' );
$imap->authenticate( 'username', 'password' );
$imap->selectMailbox( 'mailbox' ); // Inbox or another mailbox
$imap->setFlag( '1:4', 'DRAFT' );