• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

POP3 - java.net.ConnectException: Connection timed out: connect

 
Ranch Hand
Posts: 104
2
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to connect to the gmail POP3 mail server using Java Socket connection. But I am getting
"java.net.ConnectException: Connection timed out: connect"
exception. How to set the timeout property of Socket before actually connecting to the mail server? Thanks in advance.
[ October 21, 2008: Message edited by: Omkar Shetkar ]
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're timing out, it's most likely due to a firewall or connectivity issue -- i.e., something between you and the server is blocking your packets. Check with your local network admins.
 
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can debug a bit of it with a shell, connecting manually.
Just do:

telnet <hostname> 110

and see if it connects, if not, you have a firewall, access, or other problem.
 
Omkar Shetkar
Ranch Hand
Posts: 104
2
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply. I tried with the telnet command, it is not getting connected. May be a security setting avoiding the connection. Will check.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This a is a very common problem, if you want to connect to gmail...You have to go to your gmail account and allow pop3 connection. If you don't, you will get this exception. Try this and tell me if it works...

If the above doesn't work, check if you types pop3 as "pop3" not "POP3" in your code. But I think this gives a NoSuchProviderException not a ConnectionTimeOut
[ November 03, 2008: Message edited by: Devasia Manuel ]
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic