Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why doesn't the JavaMail Property "mail.pop3.timeout" work ?

861912May 13 2011 — edited Jun 13 2011
I wrote a email client with JavaMail API, it can access POP3 server and IMAP server.
But sometimes,it continues connectting the server but doesn't get any response.
That is to say,the program is executing the clause "store.connect();",but no response.
And sometimes,it successes to log on the server and begins downloading emails,but after getting part of the emails,it

doesn't get any response again.

To solve the two questions above,I use the JavaMail Property "mail.pop3.connectiontimeout" and "mail.pop3.timeout" to

cause Exception to log off the current mail session,but they don't work. What should I do?

Some code segment:

try
{
Properties props = new Properties();
props.put("mail.store.protocol",protocol);
props.put("mail.pop3.connectiontimeout","60000");
props.put("mail.pop3.timeout","300000");

URLName url = new URLName("pop3","serverAddress",110,null,"userName","password");
Session session = Session.getInstance(props,null);
Store store = session.getStore(url);
store.connect();
}
catch(Exception e)
{
e.printStackTrace();
}

Please help me !
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 11 2011
Added on May 13 2011
11 comments
841 views