Hi all,


           I'm trying to send an e-mail using camel-mail and I have a
problem with the attachments: they always arive empty.

           To generate the attachment I wrote a processor (code below). I
generate the stream in the route using "convertBodyTo". I also tried to do
some debugging in the camel-mail component and the exchange message seems to
be fine when it gets there. Any ideas ?


InputStream stream = (InputStream) msg.getBody();

String attachmentId = (String)
msg.getHeader(UtilConstants.CAMEL_FILENAME_KEY);
if (attachmentId == null){
    attachmentId = UtilConstants.CAMEL_FILENAME_KEY;
}

DataHandler handler = new DataHandler(new StreamDataSource(stream,
contentType, attachmentId));

msg.addAttachment(attachmentId, handler);
msg.setBody("");

Reply via email to