Open source software supply chain lighting plan, waiting for you>>>
Error code
javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
First of all, Youdao looks like a certificate problem after translation. Then Baidu took a look. See a lot of people encounter these problems, try one by one
The original way to get SMTP
Properties props = new Properties();
props.put(“mail.smtp.host”, host);
props.put(“mail.smtp.starttls.enable”, “true”);
props.put(“mail.smtp.auth”, “true”);
Session session = Session.getDefaultInstance(props);
Later try to add the code (host is the address of the mailbox server), you can send it. The general meaning on the Internet is that the setting service can be trusted and does not need a security certificate
props.put(“mail.smtp.ssl.trust”, host);
If not, it is possible to call SSL encryption and search on the Internet how to send SSL encrypted e-mail
Or try another way to create a session
Session session = Session.getInstance(props, new javax.mail.Authenticator()
{ protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password); } }
);
Similar Posts:
- JavaMail uses 163 mailbox to report 535 error: authentication failed
- [773]smtplib.SMTPServerDisconnected: Connection unexpectedly closed
- Troubleshooting of JavaMail “535.7.3 authentication unsuccessful”
- Python Send Email Error: smtplib.SMTPException: SMTP AUTH extension not supported by server
- [Solved] Python Error: CentOS failed to send mail without any error message
- javax.net.ssl.SSLHandshakeException: No appropriate protocol [How to Solve]
- [mailbox usage] POP3, SMTP activation and setting method of Yahoo mailbox
- Phpmailer’s solution to extension missing: OpenSSL error
- Foxmail configuration Netease enterprise mailbox – err unable to log on solution
- [Solved] smtplib Sent Email Error: SMTPDataError: (554, ‘DT:SPM 163 smtp1