I wrote an email, which has the HTML email and its plain text email related
to it.
When I receive that mail in a webmail it shows as plain text with the html
file as an attachment, though if i receive it in Outlook it shows perfect
html email.
It looks like gmail, hotmail, etc in their webmail don't permit HTML mail,
but I receive lots of newsletters with different fonts and colors in my
webmail of gmail, hotmail, etc.
Any idea how they do it?
Thanks
Maria
My code is:
HtmlEmail email = new HtmlEmail();
email.setHostName("mail.envio.com");
email.setFrom("[email protected]", "Mi nombre");
email.setCharset(HtmlEmail.ISO_8859_1);
email.setAuthentication("envio@ <en...@d>envio.com", "mypassword");
email.setBounceAddress([email protected]);
email.addTo(emailAddress, name);
email.setSubject("the subject");
email.setHtmlMsg(creaContenido(noticia));
email.setTextMsg("Doesn't support HTML email ");
email.send();
private final static String creaContenido(NoticiaVO noticia) {
String salida = "";
salida += "<html> ";
salida += "<head> </head> <body> ";
salida += "<h3> "+noticia.getTitulo() +"</h3>";
salida += "<p> <em> "+noticia.getEntradilla()+"</em></p>";
salida += " <p>"+noticia.getCiudad()+". - ";
salida += noticia.getAutor()+" <br/> "+noticia.getContenido()+"</p>";
salida += "</body> </html>";
return salida;
}