Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NoRouteToHostException need urgent help  RSS feed

Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi gurus;
Well i am trying to retrieve mail from program is perfectly running for sending mail but not working when retrieveing mail.It give following exception when using pop3:
Exception is javax.mail.MessagingException: Operation timed out: no further inf
nested exception is: Operation timed out: no further informa
Source Code is as follows:
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.mail.*;
import java.util.*;
public class RecieveMail extends javax.servlet.http.HttpServlet{
public void doGet(javax.servlet.http.HttpServletRequest req,javax.servlet.http.HttpServletResponse res){
Properties props = System.getProperties();
Session session=Session.getDefaultInstance(props,null);
Store store = session.getStore("pop3");
store.connect("","jawwad_33","super@12");//Error at this line occured
}catch(Exception e){
System.out.println("Exception is e"+e);
Will be very thankful for any kind of help.
Jawwad Ahmed

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!