• Post Reply Bookmark Topic Watch Topic
  • New Topic

NoRouteToHostException pop3 client

 
jawwad ahmed
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 www.themail.com.My 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
ormation;
nested exception is:
java.net.NoRouteToHostException: Operation timed out: no further informa
tion
////////////////////////////////////////////////
Source Code is as follows:
///////////////////////////////////////////////
import java.io.IOException;
import java.io.PrintWriter;
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){
try{
Properties props = System.getProperties();
props.put("mail.protocol.store","pop3");
Session session=Session.getDefaultInstance(props,null);
Store store = session.getStore("pop3");
store.connect("mail.themail.com","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.
Thanks
Jawwad Ahmed
 
Ankur Goyal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the pop3 server is pop.themail.com
use full username i.e jawwad_33@themail.com while connecting. I tried it out, it worked.
Relax, I did not read ur mails though.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!