trying to connect to host "mail.tr158.cn", port 50, isSSL false

来源:互联网 发布:淘宝上的电器能买吗 编辑:程序博客网 时间:2024/05/13 12:03

在javamail中出现trying to connect to host "mail.tr158.cn", port 50, isSSL false的时候,

解决方法:

1:查看你的邮件服务器配置是否正确;

2:缺少身份验证。
Session session=Session.getInstance(props, new javax.mail.Authenticator() {
            protected javax.mail.PasswordAuthentication getPasswordAuthentication() {
                 return new javax.mail.PasswordAuthentication(username, password);
            }
          });

原创粉丝点击