Retrieving email message flags

Top  Previous  Next

Upon establishing a connection to an IMAP server you may retrieve an email message along with it's message flags using the Imap#getMessageWithFlags method.  The ImapMessage class is a convenience class which contains reference to the message flags and the email message retrieved.

 

Example

 

// establish connection

imap.connect();

 

// retrieves first message in mailbox

ImapMessage message = imap.getMessageWithFlags(1);

 

// check message flags

boolean answered = message.isAnswered();

boolean deleted = message.isDeleted();

boolean draft = message.isDraft();

boolean recent = message.isRecent();

boolean seen = message.isSeen();

 

// get email message

EmailMessage email = message.getMessage();

 

 





Home | Company | Products | Solutions | Purchase | Support | Services | Blog

© 2021 JSCAPE LLC