Javamail Could Not Convert Socket to Tls Gmail

Getting MessagingException: Could not convert socket to TLS when sending mail via SMTP

Looks like something is going wrong in the JDK's SSL support. Perhaps something about the certificate from the server is confusing it. You're using a pretty old version of the JDK. I would try upgrading to a current version to see if that resolves the problem. You can also try enabling some of the low level SSL debugging output in the JDK, as described in the links in the JavaMail SSLNOTES.txt.

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

I resolved this issue by just commenting out the below property

props.put("mail.smtp.starttls.enable", "true"); 

and the code got executed with no errors or warning or simply delete this line from the above source code. It is working like a charm till date.

javax.mail.MessagingException: Could not convert socket to TLS exception in JAVA

Try to change the value of the property mail.smtp.socketFactory.class
to javax.net.ssl.SSLSocketFactory instead of javax.net.ssl.SSLsocketFactory,
The class name is case sensitive.

For more infromations about connection properties you can look at:
Where to find all available Java mail properties?

Gmail Api in spring boot : javax.mail.MessagingException: Could not convert socket to TLS

I think the reason is that Gmail blocks Access for less secure apps by default for security reasons
check this similar question it's answer may help you
Error sending email with gmail

Java Mailing Logic: Could not convert socket to TLS

Whether SSL/TLS is required or not is controlled by your mail server. If it requires it, you have to use it.

You can set the mail.smtp.ssl.trust property to ignore the certificate issue, or you can fix it as described in the JavaMail FAQ.



Related Topics



Leave a reply



Submit