Error plugins.mail.sendMail() Could not convert socket

Questions and answers on developing, deploying and using plugins and JavaBeans

Error plugins.mail.sendMail() Could not convert socket

Postby stefaniacolombara » Tue Nov 07, 2017 4:21 pm

the method sendMail() of the plugin "plugins.mail" shows the following error:

"Could not convert socket to TLS".

In particular, this the part of my code:
plugins.mail.sendMail(to, from, subject, msgText, "", "", [], properties);

and i set properties with the following parameters:
properties=["","mail.smtp.auth=true","[email protected]","mail.smtp.starttls.enable=true","mail.smtp.port=587","mail.smtp.password=ZZZZZZZ”,”

Any ideas about how to solve it?

Thank you all, Rosy
Posts: 33
Joined: Mon Feb 06, 2012 11:19 am

Re: Error plugins.mail.sendMail() Could not convert socket

Postby steve1376656734 » Sun Nov 12, 2017 10:57 am

This kind of error generally indicates a problem with the SSL certificate. There is a command line utility called smtpsend that is part of the java mail package that can be used to test the connection and get better error messages.

Does the name on the SSL certificate match the hostname you have specified? If not then change the property to match the SSL certificate name (assuming this resolves to the correct IP address). If the address does not resolve as you want it to, and you REALLY trust the mail host, then you can add to the properties. This will ignore any SSL certificate mismatches for that host and make the connection BUT be aware that you open yourself up to a man in the middle attack with this.

It is always better to resolve the SSL certificate mismatch issue rather than use this approach but it can get you out of a hole in the short term.

Hope this helps
Posts: 187
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote

Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 3 guests