• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JavaMail API for Unread yahoo messages not working.

 
Ranch Hand
Posts: 31
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Folder folder = store.getFolder("inbox");
folder.open(Folder.READ_WRITE);
Messages[] messages = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false));

using this logic i am able to get all unread messages in my gmail account, but the same logic i tried with yahoo account. it is giving all mails in my inbox.
how to get unread mails in yahoo using javamail API???

Thanks.
 
Saloon Keeper
Posts: 7582
176
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gmail is IMAP, whereas Yahoo Mail is POP, if memory serves. From http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailDeleting:

Just because a flag exists doesn't mean the flag is supported by all mail servers/providers. For instance, besides deleting messages, the POP protocol supports none of them. Checking for new mail is not a POP task but one built into mail clients. To find out what flags are supported, ask the folder with getPermanentFlags().

 
Anand Gajjar
Ranch Hand
Posts: 31
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok...i read this link.
new mail messages they have, are not supported by POP at all.
but my question is how to get new mail with different logic.???
 
Tim Moores
Saloon Keeper
Posts: 7582
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since POP doesn't support this, you need to code it in your client. Store all message IDs of mails you've already seen, and when you connect the next time, filter out all messages with those IDs.
 
Anand Gajjar
Ranch Hand
Posts: 31
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
great idea...ok i will do this...thanks for nice information.

Thank you very very much.
 
This will take every ounce of my mental strength! All for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic