Unable to send an email using SMTP (Getting javax.mail.MessagingException: Could not convert socket to TLS;)

前端 未结 11 1883
北恋
北恋 2020-12-10 12:04

I have written the following code for sending email using javamail API through SMTP as TLS as SSL is not supported but I ended up with the following exception. Please see my

11条回答
  •  失恋的感觉
    2020-12-10 12:40

    Maybe this issue related to security and smtp.ssl is not trusted that's why issue occurs.

    I resolve this issue just add a property

    spring.mail.properties.mail.smtp.ssl.trust=smtp.gmail.com
    

    Now it is working fine for me.

提交回复
热议问题