hi,
In my project,i am retrieving mails from a particular email id.
I am able to retrieve the latest mails and save it in a folder in my system.
The problem is whenever i run the program eventhough the most recently received mail in inbox is retrieved and saved,again it is retrieving the same one and saving it in the same folder(not repeating).
I tried to check the newmessages in the inbox using the folder.hasNewMessage() method in
java mail api,but the method is returning false only regardless new mail is there in inbox or not.
I want to read the unread messages only.Dont want to retrieve the already read mails.
I got the mail retrieving code from the below site.(sorry not posting the code because it is so long and having 4 classes)
http://www.builderau.com.au/program/java/soa/Getting_the_mail_in_receiving_in_JavaMail/0,39024620,39228060,00.htm Can anyone tell me how to read unread mails in the inbox?
Thanks a lot