In case you encounter this error message when using JavaMail to connect to, say, GMail’s SMTP server, there is one property that needs to be present, mail.smtp.starttls.enable = true.

If, however the same error message persists, the following properties need to be added in order for this to work.

  • mail.smtp.socketFactory.port = 465
  • mail.smtp.socketFactory.class =
  • mail.smtp.socketFactory.fallback = false

There, that should fix that annoying STARTTLS error message using JavaMail.

Related Posts Plugin for WordPress, Blogger...