Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java mail with proxy server

843834Mar 8 2009 — edited Mar 9 2009
Hi I am a novice, working on a mail sender though proxy. I read Java mail FAQ in http://java.sun.com/products/javamail/FAQ.html#proxy.
And also I found a snippet in below therad.
http://forums.sun.com/thread.jspa?threadID=615715&start=0&tstart=0

<QUOTE>here is the solution that you can send mail through a proxy server
Properties p = System.getProperties();
         p.setProperty("proxySet","true");
         p.setProperty("socksProxyHost","192.168.155.1");
         p.setProperty("socksProxyPort","1080");
</QUOTE>

I installed CCProxy in my machine and gave my own IP address ( 1. LAN IP and 2. IP from whatismyip.com; both works ) and port number. It works. But I gave IP addrss of my friend ( 1. LAN IP and 2. IP from whatismyip.com; both NONE work ) who got CCProxy and in his machine. But doesnt work ( throws Below exception).
..............
Exception in thread "main" javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
  nested exception is:
        java.net.SocketException: Can't connect to SOCKS proxy:Connection timedout: connect
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
        at javax.mail.Service.connect(Service.java:310)
..........
.

His IP address is found with whatismyip.com. I guess its a problem with IP address. What am I doing wrong here ?? Could some one help me out please ?

Edited by: baskark on Mar 8, 2009 6:26 PM

Edited by: baskark on Mar 8, 2009 6:44 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 6 2009
Added on Mar 8 2009
4 comments
1,058 views