Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String enviarEmail(@HeaderParam("token") String token, Email mail) throws Exception {
- try {
- HtmlEmail email = new HtmlEmail();
- email.setCharset(EmailConstants.UTF_8);
- email.setHostName("myHost");
- email.setStartTLSEnabled(true);
- email.setSmtpPort(99);
- String[] destinatarios =(String[])mail.getLstDestinatarios().toArray(new String[0]);
- email.addBcc(destinatarios);
- email.setFrom(mail.getRemetente());
- email.setSubject(mail.getAssunto());
- email.setHtmlMsg(mail.getMensagem());
- email.send();
- return "email enviado com sucesso";
- } catch (Exception e) {
- e.printStackTrace();
- throw new WebApplicationException(e);
- }
Add Comment
Please, Sign In to add comment