Details
Description
For various reasons I am trying to use Gmail as my SMTP server for outgoing messages. I ran into two issues which I am reporting separately. The first issue was that the only I could use a gmail account for such a server is if I used port 587 with TLS. I tried port 465 with SSL but couldn't connect, but, the former combination does work. This means being able to add the properties:
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
to the javamail session initiator.
I wound up writing a custom appender based on SMTP appender and manager that provided this feature. I am dropping in this code for reference only. It is intended for Gmail only and is not production worthy.