A good Java implementation of SMTP and extended SMTP.
jSMTP is using slf4j, so Maven is the best way to include jSMTP:
<repositories>
<repository>
<id>hellsh</id>
<url>https://mvn2.hell.sh</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>sh.hell</groupId>
<artifactId>jsmtp</artifactId>
<version>[1.1.0,2.0.0)</version>
</dependency>
</dependencies>
Using the power of openssl & keytools, you can convert a certificate.crt + private.key into a .jsmtp_keystore using password 123456 which you can then use as follows:
new SMTPServer(mySMTPEventHandler, ".jsmtp_keystore", "123456");