camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashwin Karpe <aka...@fusesource.com>
Subject Re: ProducerTemplate for sending mails with attachements
Date Fri, 30 Mar 2012 12:56:07 GMT
Hi,

In order to do this, you need to send an Exchange instead of body and
headers...

Please check out the code below...

Cheers,

Ashwin...

=======================================================
        Exchange exchange =
context.getEndpoint("direct:exception").createExchange(ExchangePattern.InOnly);
        exchange.getIn().setBody("Hello World");
        exchange.getIn().addAttachment("foo", new DataHandler(....));

        Exchange out = template.send("direct:exception", exchange);

=======================================================

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com 
---------------------------------------------------------
--
View this message in context: http://camel.465427.n5.nabble.com/ProducerTemplate-for-sending-mails-with-attachements-tp5605511p5606572.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message