camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Email character encoding?
Date Thu, 24 Jun 2010 12:52:10 GMT
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

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


Mime
View raw message