This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other JSE/JEE APIs and the fly likes retrieving only new messages using POP3-Possible???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "retrieving only new messages using POP3-Possible???? " Watch "retrieving only new messages using POP3-Possible???? " New topic
Author

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

Himanshu Bisht
Ranch Hand

Joined: Aug 27, 2004
Posts: 96
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
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

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.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: retrieving only new messages using POP3-Possible????