Claus Ibsen wrote:
On Thu, Jun 24, 2010 at 2:52 PM, Willem Jiang <[email protected]> wrote:
Hi,

I just check the Java document of MimeMessage[1], the message subject *must*
contain only US-ASCII characters, maybe that cause your problem.

[1]http://java.sun.com/products/javamail/javadocs/javax/mail/internet/MimeMessage.html


Ah there is an overloaded setSubject which accepts a charset. Do we
use that in the camel-mail code?


Yes, we used it in camel 2.3, but I think there could be something wrong with getting the default charset from the exchange.


Willem Jiang wrote:
Mattias Severson wrote:
Hi,

I am having trouble sending ISO-8859-1 characters, e.g. åäö, in emails. I
have tried to set the defaultEncoding option of the
http://camel.apache.org/mail.html Camel Mail  component to ISO-8859-1, but
that did not solve the problem.
The sender is implemented as

producerTemplate.sendBodyAndHeaders(emailRecipientUri, emailBody,
camelEmailHeaders);
Maybe you need to set the Exchange.property for the charset like this

producerTemplate.send(emailRecipientUri, new Processor() {
  void process(Exchange exchange) throws Exception {
      exchange.getIn().setBody(emailBody);
      exchange.getIn().setHeaders(camelEmailHeaders);
      exchange.setProperty(Exchange.CHARSET_NAME, "ISO-8859-1");
  }
}

Willem
----------------------------------
Apache Camel, Apache CXF committer
Open SOA http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang
and I am using Camel 2.3.0


Any ideas?

/Mattias










Reply via email to