JavaMail API - FAQ - Oracle | Integrated Cloud Applications and Platform Services
String host = "smtp.gmail.com"; String username = "user"; String password = "passwd"; Properties props = new Properties(); props.setProperty("mail.smtp.ssl.enable", "true"); // set any other needed mail.smtp.* properties here Session session ......