fetching email from gmail - connect failed

Hello!

I'm trying to connect to pop.gmail.com but I'm receiving the following exception:

javax.mail.MessagingException: Connect failed

at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:148)

at javax.mail.Service.connect(Service.java:275)

at javax.mail.Service.connect(Service.java:156)

at javax.mail.Service.connect(Service.java:105)

at main.GmailUtilities.connect(mailtest.java:59)

at main.mailtest.main(mailtest.java:242)

Caused by: java.net.ConnectException: Connection timed out: connect

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.PlainSocketImpl.doConnect(Unknown Source)

at java.net.PlainSocketImpl.connectToAddress(Unknown Source)

at java.net.PlainSocketImpl.connect(Unknown Source)

at java.net.SocksSocketImpl.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)

at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(Unknown Source)

at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)

at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:163)

at com.sun.mail.pop3.Protocol.<init>(Protocol.java:81)

at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:201)

at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:144)

... 5 more

I can ping pop.gmail.com but I can't telnet it using port 995 (as gmail sais) or port 110 (pop3 default port).

I guess it's not a problem of my code, right? I'm using code from the following link:

http://www.java-tips.org/other-api-tips/javamail/connecting-gmail-using-pop3-connection-with-ssl-2.html

Can you please give me some ideas to solve that.

Greetings,

Filipe

[1860 byte] By [filipea] at [2007-11-27 1:19:53]
# 1
Answered in the other thread where you posted the same question: http://forum.java.sun.com/thread.jspa?forumID=43&threadID=5124792
bshannona at 2007-7-11 23:56:29 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...