You are correct. I have slightly updated the code to attach a dynamic file.
The follow code works OK.

from(file://...)...
public void process(Exchange exchange) throws Exception {                       
                
        Message in = exchange.getIn();
        String file = in.getBody(String.class);
        String fileId = in.getHeader("CamelFileName",String.class);
        in.addAttachment(fileId, new DataHandler(file,"text/plain"));
}
.to(file://...)



--
View this message in context: 
http://servicemix.396122.n5.nabble.com/Cannot-send-email-with-attachment-tp5720765p5720772.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to