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 through Proxy

843830Sep 10 2001 — edited Sep 22 2001
Hi,
I am trying to send a mail using the proxy.The code is as follows:
System.getProperties().put("proxySet", "true");
System.getProperties().put("proxyHost", hostname);
System.getProperties().put("proxyPort", portnumber);
Properties props = System.getProperties();
Session session = Session.getDefaultInstance(props,null);
Store store = session.getStore("pop3");
store.connect("pop.mail.yahoo.com",user,password);

When I run my programme,I get the Exception as:
Exception in thread "main" javax.mail.MessagingException: Connect failed;
nested exception is:
java.net.UnknownHostException: pop.mail.yahoo.com
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:106)
at javax.mail.Service.connect(Service.java:234)
at javax.mail.Service.connect(Service.java:135)
at MailYahoo.main(MailYahoo.java:19)

I am behind a firewall and access the Internet using proxy.
Please let me know what could be the possible reason for this code not working,and what needs to be done.
Thanks,
Shipra
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2001
Added on Sep 10 2001
3 comments
492 views