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
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.