commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maria maria <xaelf...@gmail.com>
Subject Html mail sent to gmail or hotmail is received as attachment file
Date Tue, 29 Dec 2009 14:41:47 GMT
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("no-responda@envio.com", "Mi nombre");
  email.setCharset(HtmlEmail.ISO_8859_1);
  email.setAuthentication("envio@ <envio@d>envio.com", "mypassword");
  email.setBounceAddress(envio@envio.com);

  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;
 }

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message