Claus Ibsen wrote:
On Fri, Jun 25, 2010 at 11:39 AM, Willem Jiang <[email protected]> wrote:
No, the charset property is set on the Exchange, you can't add it from the
message header.
You have to set it from a processor.


There is a setProperty in the DSL you can use instead of the Processor

Oh, you can define a route to do that :)

from("direct:send").setProperty(Exchange.CHARSET_NAME, "ISO-8859-1").to(emailRecipientUri);

Then use below code to send the message

producerTemplate.sendBodyAndHeaders("direct:send", emailBody,
 camelEmailHeaders);

Willem



Willem

Mattias Severson wrote:
Thanks for the tip. I am currently on a "long-weekend" vacation, but I
will
try when I return to work.
Do I have create a Process in order to set the Exhange.CHARSET_NAME on the
exchange is i possible to take a shortcut and add it to the camel email
headers directly, e.g.

Map<String, Object> camelEmailHeaders = new HashMap<String, Object>();
camelEmailHeaders.put(Exchange.CHARSET_NAME, "ISO-8859-1");
// add more email headers...
producerTemplate.sendBodyAndHeaders(emailRecipientUri, emailBody,
camelEmailHeaders);
/Mattias





Reply via email to