I am currently trying to set a visible flag in an IMAP email as follows:
messages[EmailNumber].setFlag(Flag.SEEN, true); messages[EmailNumber].saveChanges();
Where messages [] is an array of the Message object filled with downloading all the letters in the folder (for which read / write access is set), and MailNumber is a specific email in the array calculated by the user via email in JTable, which I fill out with your emails letters.
However, this continues to give me this on the second line:
javax.mail.IllegalWriteException: IMAPMessage is read-only
Even if I populate the message array (in another function) as follows:
folder.open(Folder.READ_WRITE); messages = folder.getMessages();
What's going on here?
source share