camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bharath <bharath4...@gmail.com>
Subject Re: Email Attachments - Adding to Exchange Attachments
Date Fri, 20 Sep 2013 09:55:14 GMT
Hi Regi,

            "Attachments are not support by all Camel components
The Attachments API is based on the Java Activation Framework and is
generally only used by the Mail API. Since many of the other Camel
components do not support attachments, the attachments could potentially be
lost as they propagate along the route. The rule of thumb, therefore, is to
add attachments just before sending a message to the mail endpoint"

Example:
Message in = exchange.getIn();
in.setBody("Hello World");
in.addAttachment("logo.jpeg", new DataHandler(new
FileDataSource("src/test/data/logo.jpeg")));

For More Details please refer camel mail component
http://camel.apache.org/mail.html


Cheers!!!
Bharath.R




--
View this message in context: http://camel.465427.n5.nabble.com/Email-Attachments-Adding-to-Exchange-Attachments-tp5739863p5739865.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message