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.

Reply via email to