camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From borgel <>
Subject How to add attachement
Date Tue, 15 Jan 2008 11:34:58 GMT

I need to send a message either to an e-mail address or upload it to a ftp
server, based on some criteria. The mail message should contain a text and a
list of attachement. When uploading to a ftp server all attachement should
be uploaded to the same folder.
I decided to give Camel a try for this mission.

 - How can I add several attachment to an e-mail?
 - When uploading files to a ftp server the attachements are stored in
folders with some cryptic names. How do i specify where to store the
 - The attachments loses their names and extension, and not readable after
upload (except for attachment only containing text).

Here is my test code:
CamelContext context = template.getContext();		
Endpoint<Exchange> endpoint = context.getEndpoint("direct:a");
Producer<Exchange> producer = endpoint.createProducer();		
Exchange exchange = endpoint.createExchange();        
exchange.getIn().setHeader("receipients", recipients);  
File file1 = new File("C:\\temp\\test.pdf");              

 protected RouteBuilder createRouteBuilder() {		 	
	        RouteBuilder builder = new RouteBuilder() {
	    	    public void configure() {
	    	        	.setHeader("subject", constant("My subject"))	    	        	    	        
	        return builder;

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message