mailProps.put("mail.smtp.socketFactory.port", "465");
mailProps.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
mailProps.put("mail.smtp.socketFactory.fallback", "false");
//EH NECESSARIO AUTENTICAR
Session mailSession = Session.getInstance(mailProps, new Authenticator() {
public PasswordAuthentication getPasswordAuthentication(){
return new PasswordAuthentication(emailRemetente, senhaRemetente);
}
});
mailSession.setDebug(false);