javax.mail.MessagingException: Could not connect to SMTP host: smtp.exg6.exghost.com, port: 25;
nested exception is:
java.net.SocketException: Permission denied: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
at javax.mail.Service.connect(Service.java:295)
Using java Mail API with JDK 6 it's work proerly with any changes in code or arguments.
But here in same code with JDK 7 ,it will throe an error... Could not connect..
[Solution]
Here in JDK 7 brings support for IPv6 on Windows.
When you try to connect to an IPv4 address then it will use an IPv4-mapped IPv6 address.
So we have to add an arguments when run the java program,
like
> java -Djava.net.preferIPv4Stack=true package.Sample
[source] http://download.java.net/jdk7/archive/b123/docs/api/java/net/doc-files/net-properties.html
nested exception is:
java.net.SocketException: Permission denied: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
at javax.mail.Service.connect(Service.java:295)
Using java Mail API with JDK 6 it's work proerly with any changes in code or arguments.
But here in same code with JDK 7 ,it will throe an error... Could not connect..
[Solution]
Here in JDK 7 brings support for IPv6 on Windows.
When you try to connect to an IPv4 address then it will use an IPv4-mapped IPv6 address.
So we have to add an arguments when run the java program,
like
> java -Djava.net.preferIPv4Stack=true package.Sample
[source] http://download.java.net/jdk7/archive/b123/docs/api/java/net/doc-files/net-properties.html
No comments:
Post a Comment