简体   繁体   English

无法连接到SMTP端口465

[英]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.

相关问题 无法连接到SMTP主机:smtp.gmail.com,端口:465 - could not connect to smtp host:smtp.gmail.com, port:465 无法在端口 465 连接到 smtp.gmail.com - Couldnot connect to smtp.gmail.com at port 465 无法连接到 smtp 主机 ovh 服务器端口 465 - Could not connect to smtp host ovh server port 465 ERROR ANDROID:无法连接到SMTP主机:smtp.gmail.com,port:465,响应:-1 - ERROR ANDROID: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1 无法连接到SMTP主机:smtp.gmail.com,port:465,响应:-1 - Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1 javax.mail.MessagingException:无法连接到 SMTP 主机:smtp.gmail.com,端口:465; - javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465; GCP GKE SMTP 端口 465 连接重置 - GCP GKE SMTP port 465 connection reset 如何解决以下问题:javax.mail.MessagingException:无法连接到 SMTP 主机:smtp.gmail.com,端口:465;? - How to solve the issue with: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;? java.lang.RuntimeException:javax.mail.MessagingException:无法连接到SMTP主机:smtp.gmail.com,端口:465 - java.lang.RuntimeException: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465 JavaMail 无法连接到 SMTP 主机 SSL 465:handshake_failure - JavaMail Could not connect to SMTP host SSL 465: handshake_failure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM