SMTP Implementation with SSL/TLS
There are many ways to implement in java, But mostly used are javax.mail api provided by java and apache commons-net jar . I personally preferred commons-net over java API as it simplify the implementation as it builds on java api. (see below link) Only Difference between Simple mail and TLS mail is to provide encrypted channel between to sender-server to mail-server Commons-net Implementation of SMTP with TLS public class CommonsNetSMTP { //Mail-Server public static final String SMTP_SERVER_ADDRESS = "mail-server"; // SSL/TLS Port; can be different according to server public static final int SMTP_PORT = 587; // Sender Mail-Address public static final String FROM = "from@domain.com"; // Receiver Mail-Address public static final String TO = "to@domain.com"; // Subject of email public static final String SUBJECT = "subject"; // Body of email public static final String BODY = "bod