Downloading all the mails (read/unread) from the mail server
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Senthil_Kumar
Posted On:   Wednesday, October 3, 2001 02:44 AM

How can i read all the mails (read/unread) mails from my mail server?. I need to display all the mails in my mail account.I used the following code but i am able to fetch only the new mails and not the ones that are already read. I used the following code to fetch the mails: Store store = session.getStore("pop3"); store.connect(host, username, password); Folder folder = store.getFolder("INBOX"); folder.open(Folder.READ_ONLY); for (int i=0, n=message.length; i System.out.println(i + ": " + message[i].getFrom()[0] + " " + message[i].getSubject()); ...... I get only new mail   More>>

How can i read all the mails (read/unread) mails from my mail server?.
I need to display all the mails in my mail account.I used the following code but i am able to fetch only the new mails and not the ones that are already read.
I used the following code to fetch the mails:

			

Store store = session.getStore("pop3");

store.connect(host, username, password);

Folder folder = store.getFolder("INBOX");

folder.open(Folder.READ_ONLY);

for (int i=0, n=message.length; i


System.out.println(i + ": " + message[i].getFrom()[0]
+ " " + message[i].getSubject());

......



I get only new mails as o/p....
can anyone help me
Thanks.    <<Less

Re: Downloading all the mails (read/unread) from the mail server

Posted By:   venkat_subramanian  
Posted On:   Wednesday, October 3, 2001 05:42 PM

Use IMAP instead if you can. I am not sure why you can't get all messages in a folder using POP.
With IMAP the code is similar, and surely works.
About | Sitemap | Contact