HtmlEmail shows wrong format

79 Views Asked by At

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("[email protected]", "BKOffice");
email.setSubject("Recuperação de Senha");
email.setHtmlMsg("<html><body><h1>TESTE!!!</h1></body></html>");
email.addTo("[email protected]", "Maruero");

email.send();

I'm getting two behaviour with the same code. When I run using main(String[] args) it works.

enter image description here

When I run it deployed on Tomcat it does not work.

enter image description here

Someone please help!

0

There are 0 best solutions below