[邮件发送错误] : Sending the email to the following server failed : smtp.qiye.163.com:25, {}org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.qiye.163.com:25 at org.apache.commons.mail.Email.sendMimeMessage(Ema
研究了近一天的时间,通过查阅相关资料,终于对java发送邮件的机制,原理有了一点点的理解,希望能够帮到大家! 1.首先要向你的项目里导入1个jar包:mail-1.4.4.jar即可(实现qq和163邮箱发送其他邮箱(此案例只演示一种)) 2.代码如下所示 public class TestDemo1 { static String SSL_EMAIL = "javax.net.ssl.SSLSocketFactory"; //需要传的值都在main方法调用的sendmail里传! p