This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

retrieving only new messages using POP3-Possible????  RSS feed

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am making an application in which i want to retrieve new mails from my inbox,read their body and then update database using those values.

The problem is when ever i am reading my INBOX ,program is reading all the mails whereas i want to read only new mail.

Is is possible to read only new mails without deleting using POP3

thanks in advance

himanshu
 
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by himanshu bisht:
Hi

I am making an application in which i want to retrieve new mails from my inbox,read their body and then update database using those values.

The problem is when ever i am reading my INBOX ,program is reading all the mails whereas i want to read only new mail.

Is is possible to read only new mails without deleting using POP3

thanks in advance

himanshu



Himansu:

From what I found on the notes at java.sun.com, this does not seem to be possible.


The Folder class also defines a getNewMessageCount() method to count the number of new messages in the Folder. However you shouldn't use it if you use a POP server -- remember POP doesn't support the concept of "new" messages.



It seems to me that you could keep a local list of the messages that you have already read -- any that are not in that list are then "new;" but this is something that you would have to do yourself.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!