Html mail sent to gmail or hotmail is received as attachment file

2009-12-29 Thread maria maria
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-respo...@envio.com, Mi nombre);
  email.setCharset(HtmlEmail.ISO_8859_1);
  email.setAuthentication(envio@ en...@denvio.com, mypassword);
  email.setBounceAddress(en...@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;
 }


Re: Html mail sent to gmail or hotmail is received as attachment file

2009-12-29 Thread Siegfried Goeschl
Hi,

which version of commons-email are you currently using -
commons-email-1.2 fixed this issues (hopefully)

Cheers,

Siegfried Goeschl



maria maria wrote:
 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-respo...@envio.com, Mi nombre);
   email.setCharset(HtmlEmail.ISO_8859_1);
   email.setAuthentication(envio@ en...@denvio.com, mypassword);
   email.setBounceAddress(en...@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;
  }

   

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org