File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Setting flags in javax.mail package . Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Setting flags in javax.mail package ." Watch "Setting flags in javax.mail package ." New topic

Setting flags in javax.mail package .

vikas tarade

Joined: Oct 06, 2001
Posts: 5
When a mail is read from the mailbox using
message.getContent() method,the flag(ie.SEEN)was set to true as
then the folder is closed.
When i return to the folder again the flag on the read message is found to be false.It is not getting set in the saved folder.
So how can I set the flag to true permanently.
Please reply urgently.
vikas tarade.
Lewin Chan
Ranch Hand

Joined: Oct 10, 2001
Posts: 214
If using the Sun POP3 provider, then a message's permanent flags (such as SEEN/RECENT) cannot be set. You can have a look at the sundocs supplied in the JavaMail api to see the exact details of the POP3 implementation.
Alternatively, you coulddo a message.saveChanges() to commit the changes

I have no java certifications. This makes me a bad programmer. Ignore my post.
rayFancyD leeD

Joined: Jul 23, 2003
Posts: 2
i opened the folder in Folder.Read_Write mode,then i do msgs[i].saveChanges(), but i met problem and the error message is : javax.mail.IllegalWriteException OP3 Messages are read-only. what could i do to make the change permanent ?

I agree. Here's the link:
subject: Setting flags in javax.mail package .
It's not a secret anymore!