Search This Blog

Wednesday, October 8, 2014

Jenkins Email Error: Network is unreachable

Jenkins > Email > Network is unreachable error

send failed, exception: javax.mail.MessagingException: Could not connect to SMTP host:     , port: 25;
nested exception is:  java.net.SocketException: Network is unreachable: connect


Solution:

The problem is because java 1.7 uses IPv6 by default.
To fix this add Java Option from command line:

setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true**