javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure. Failed messages: javax.mail.MessagingException: Can't send command to SMTP host;


問題描述:

使用spring+JavaMailSenderImpl發送郵件

發送端口為25

但是出現報錯如下:

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure. Failed messages: javax.mail.MessagingException: Can't send command to SMTP host;

 

解決方法:

關於ssl使用的是465端口

普通發送郵件使用的是25端口

 

當使用ssl時,需要開端口,配置加密參數

 

當使用普通發送郵件時,考慮將ssl相關項關閉

 

所以,修復操作如下:

 

<prop key="mail.smtp.starttls.enable">false</prop>
<prop key="mail.smtp.ssl.enable">false</prop>
配置端口為25

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM