ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick <patrickinminneapo...@gmail.com>
Subject how i fixed my email html problem
Date Wed, 14 Apr 2010 18:39:22 GMT
I don't really know how it works, but this is what I did

ByteArrayInputStream byter = new ByteArrayInputStream(body.getBytes());
mail = new MimeMessage(session, byter);   //this is a change, the
EmailServices.java code uses this constructor MimeMessage(session)
with one 1 arg
mail.addHeaderLine("Content-Type: text/html; charset=UTF-8"); //this
new constructor defaults to text/plain so you have to feed it
text/html here

//then later I turned off this
/*
mail.setText(body, "UTF-8", "html"); // third arg is actually
contentType.subString something or other
mail.saveChanges();  //this was mangling my chars :(
*/

since I'm thrilled about this, I thought I'd share
I'm on 64bits, I wonder if that makes a difference.

Mime
View raw message