Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mail.setFrom("teste.email.send@gmail.com", "Teste");
- mail.setSubject("E-mail exemplo");
- mail.setMsg("E-mail de exemplo");
- mail.setSSLOnConnect(true);
- mail.setAuthentication("teste.email.send@gmail.com", "********");
- mail.setHostName("smtp.gmail.com");
- mail.addTo("meu.email@gmail.com", "Lucas Souza");
- mail.setSmtpPort(587);
- mail.send();
- } catch (EmailException ex) {
- Logger.getLogger(Email.class.getName()).log(Level.SEVERE, null, ex);
- }
- org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:465
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement