POP3: folder.getMessages() returns an empty array!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   John_Hategeka
Posted On:   Wednesday, July 31, 2002 01:51 AM

Hi! When I execute the following code, It displays: Number messages = 0 ... Properties props = System.getProperties(); session = Session.getDefaultInstance(props, null); store = session.getStore("pop3"); store.connect(host, username, password ); folder = store.getFolder("INBOX"); folder.open(Folder.READ_WRITE); Message message[] = folder.getMessages(); int nbMsg = message.length ; System.out.println(" Number messages = " + nbMsg ) ; ... However, I am sure that my INBOX folder is not empty. Using Outlook for example,    More>>

Hi!

When I execute the following code,

It displays:

Number messages = 0

...

Properties props = System.getProperties();

session = Session.getDefaultInstance(props, null);

store = session.getStore("pop3");

store.connect(host, username, password );

folder = store.getFolder("INBOX");

folder.open(Folder.READ_WRITE);

Message message[] = folder.getMessages();

int nbMsg = message.length ;

System.out.println(" Number messages = " + nbMsg ) ;

...



However, I am sure that my INBOX folder is not empty.

Using Outlook for example,

I can see there are 11 unread messages.

and the code was working well last week!



What is wrong? What can I do in order to fetch the

messages programmatically?



Thanks!

   <<Less

Re: POP3: folder.getMessages() returns an empty array!

Posted By:   John_Zukowski  
Posted On:   Saturday, August 3, 2002 07:46 PM

Outlook removed the messages from the server and copied them to the client. Change outlook to leave the messages on the server.
About | Sitemap | Contact