[英]Unable to connect to SMTP Port no 465
I am not able to connect to smtp port no 465, which uses SSL authentication. 我无法连接到使用SSL身份验证的smtp端口465。 Earlier it used to work in default port 25, but have changed the setting to point to 465 for outbound emails for all outgoing emails.
以前它曾经在默认端口25上工作,但已将所有外发电子邮件的出站电子邮件设置更改为指向465。 This works perfectly fine when i use outlook but shows that it cannot connect to port 465.
当我使用Outlook时,这工作得很好,但显示它无法连接到端口465。
Below is the error. 下面是错误。
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: smtp.bizmail.yahoo.com, port: 465
at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
And below is the Javax Mail setting that i use. 下面是我使用的Javax Mail设置。
Properties props = System.getProperties();
props.put("mail.smtp.host", host);
props.put("mail.smtp.socketFactory.class",
props.setProperty("mail.smtp.port", "465");
props.put("mail.smtp.ssl.enable", "true");
props.put("mail.smtp.starttls.enable","true");
props.put("mail.server.username", "test@gamil.com");
props.put("mail.server.password", "test123");
props.put("mail.smtp.auth", "true");
props.setProperty("mail.smtp.submitter", authenticator.getPasswordAuthentication().getUserName());
Session session = Session.getInstance(props, authenticator);
session.setDebug(sessionDebug);
Any help would be much appreciated. 任何帮助将非常感激。
As the log says, smtp.bizmail.yahoo.com
at port 465 cannot be connected, if you are using gmail, the host should be: smtp.gmail.com
. 如日志所述,无法连接端口465上的
smtp.bizmail.yahoo.com
,如果您使用的是gmail,则主机应为: smtp.gmail.com
。
For reference: 以供参考:
Gmail- Host: smtp.gmail.com , Port: 465 Gmail-主机:smtp.gmail.com,端口:465
Hotmail- Host: smtp.live.com , Port: 587 Hotmail-主机:smtp.live.com,端口:587
Yahoo- Host: smtp.mail.yahoo.com , Port: 465 Yahoo-主机:smtp.mail.yahoo.com,端口:465
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.