Java Mail mystery - SMTP blocked?

后端 未结 6 1233
孤城傲影
孤城傲影 2020-12-09 05:40

I have a Java program which uses javax.mail to send an SMTP message. This program works fine on a Linux box, I want to emphasize that beforehand. When I try this same cod

6条回答
  •  孤城傲影
    2020-12-09 05:42

    I had the same problem during upgrade form java 1.6 to java 1.7. The problem occured because java 1.7 using IPv6 by default. To fix this, you need to add Java Option like on example below.

    Just run this command on Windows cmd:

    setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true
    

提交回复
热议问题