I have a local mail server (hMailServer) with SSL (port 465) and a self-signed certificate.
Domain is \"foobar.com\"
I have setup my Properties
This the solution for JavaMail SSL with no Authentication trust certificate using Spring framework, change your .xml file as describe below.You can see the solution in the snapshot See the image description here
javax.net.ssl.SSLSocketFactory true
change it to false if you want mail server must be in ssl
The best solution for this is to use the following line
MailSSLSocketFactory socketFactory = new MailSSLSocketFactory();
socketFactory.setTrustAllHosts(true);
You asked for an "smtps" transport. You set the properties for the "smtp" transport. Since you've set the "mail.smtp.ssl.enable" property to "true", you can just ask for an "smtp" transport and it will use SSL.