I am using the JavaMail API to fetch mails. Earlier today I succeeded in doing so with Gmail. Now I tried Yahoo Mail and it worked too.
One problem though:
It doesn’t show if the mail has been read or not correctly. I have a mailbox full of mails that have been read, though the application says I haven’t.
I use this to determine if a mail that is fetched, have been read or not:
String isRead = (message[i].getFlags().contains(Flags.Flag.SEEN) ? "Yes" : "No");
It works with Gmail. Just not with Yahoo Mail.
Anyone got any idea why this might be?
What protocols are you using? I know Gmail supports IMAP so I assume that is what you are using there. Does Yahoo? If they only support POP3 then the flags won’t work because POP3 doesn’t support flags.
Try seeing what Folder.getPermanentFlags() returns.