15,000 Jobs Available in:
Java, ASP, C#, PHP, SQL, SAP, MySQL and many more.
- Class Quick -
The moose likes Other JSE/JEE APIs and the fly likes error in retrieving mail through a proxy. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "error in retrieving mail through a proxy." Watch "error in retrieving mail through a proxy." New topic
Author

error in retrieving mail through a proxy.

gayathri murugesan
Ranch Hand

Joined: Dec 21, 2009
Posts: 31
we are retrieving mail from gmail server.we could connect to the gmail server without proxy. As there is a proxy setting in our college we couldn't connect to the gmailserver even after setting the system properties. we could connect to gmail.com from our browser but we couldn't connect from our program.



please help!

This message was edited 1 time. Last update was at by Maneesh Godbole

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 7059

Gayathri,

Please not the code tags are [code] and not <code>. Or you can use the Code button.
We have a forum dedicated for java mail. I will move this thread there for you.

What error did you get when you say [i]"we couldn't connect to the gmailserver"[i]. Can you post the stack trace?
Is there any firewall blocking the port?


[Donate a pint, save a life!] [How to ask questions]
gayathri murugesan
Ranch Hand

Joined: Dec 21, 2009
Posts: 31
we get this exception


java.net.UnknownHostException: imap.gmail.com
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:618)
at javax.mail.Service.connect(Service.java:291)
at javax.mail.Service.connect(Service.java:172)
at EmailClient.connect(EmailClient.java:373)
at EmailClient.main(EmailClient.java:475)
by: java.net.UnknownHostException: imap.gmail.com
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:284)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:201)
at com.sun.mail.iap.Protocol.<init>(Protocol.java:109)
at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:104)

at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:585)
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 12868

From the browser you connect via HTTP. So an HTTP proxy works for that. From your program you don't connect via HTTP. So an HTTP proxy doesn't work for that.

You would have to talk to the network administrators at your college to get them to open up port 993 for you.
 
 
subject: error in retrieving mail through a proxy.
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture