I'm sending e-mails using this code:
HtmlEmail email = new HtmlEmail();
email.setHostName("webmail.diastecnologia.com.br");
email.setSmtpPort(587);
email.setAuthenticator(new DefaultAuthenticator("marcelo", "senha"));
email.setStartTLSEnabled(bkEmail.getStatusTlsStart());
email.setFrom("marcelo@diastecnologia.com.br", "BKOffice");
email.setSubject("Recuperação de Senha");
email.setHtmlMsg("<html><body><h1>TESTE!!!</h1></body></html>");
email.addTo("marueru@gmail.com", "Maruero");
email.send();
I'm getting two behaviour with the same code. When I run using main(String[] args) it works.
When I run it deployed on Tomcat it does not work.
Someone please help!