gpt4 book ai didi

email - javax.mail.MessagingException : Can't send command to SMTP host; nested exception is: javax.net.ssl.SSLKeyException:RSA 预主 key 错误

转载 作者:行者123 更新时间:2023-12-01 04:59:11 25 4
gpt4 key购买 nike

在jdk1.4中我可以发送邮件,但是当我尝试使用jdk1.6发送邮件时出现以下异常。

My Working Environment.========================1.OS       :  windwos 20082.JAVA     :  JDK1.63.Mail Api :  java mail1.44.Email    :  gmail5.smtp port:  465 or 587
Exception in thread "main" java.lang.RuntimeException: javax.mail.MessagingException: Can't send command to SMTP host;nested exception is:    javax.net.ssl.SSLKeyException: RSA premaster secret error    at SendMailTLS.main(SendMailTLS.java:47)Caused by: javax.mail.MessagingException: Can't send command to SMTP host;nested exception is:    javax.net.ssl.SSLKeyException: RSA premaster secret error    at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1365)    at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1353)    at com.sun.mail.smtp.SMTPTransport.ehlo(SMTPTransport.java:794)    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:336)    at javax.mail.Service.connect(Service.java:258)    at javax.mail.Service.connect(Service.java:137)    at javax.mail.Service.connect(Service.java:86)    at javax.mail.Transport.send0(Transport.java:150)    at javax.mail.Transport.send(Transport.java:80)    at SendMailTLS.main(SendMailTLS.java:42)

最佳答案

您使用的是最新版本的JDK吗?您能提供无法运行的源代码吗?请显示邮件代码的输出:

  • System.out.println("Java 版本:"+ System.getProperty("java.version"));
  • System.out.println("扩展目录:"+System.getProperty("java.ext.dirs"));

关于email - javax.mail.MessagingException : Can't send command to SMTP host; nested exception is: javax.net.ssl.SSLKeyException:RSA 预主 key 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13605354/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com