Hi,
I'm using FUSE ESB 4.3.1-fuse-01-09 and the camel version is 2.6.0. I just downloaded the 2.6.0 tag from the repo because I was trying to debug using trunk and I think there were some differences. I'll have a look at the unit tests also. Sorin. On Fri, Apr 22, 2011 at 11:49 AM, Claus Ibsen <claus.ib...@gmail.com> wrote: > On Fri, Apr 22, 2011 at 9:33 AM, Sorin Silaghi <sorin7...@gmail.com> > wrote: > > 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. > > > > Have you seen some of the unit tests in camel-mail which tests with > attachments? > > Also what version of Camel do you use? And what server/runtime do you use? > > > > 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(""); > > > > > > -- > Claus Ibsen > ----------------- > FuseSource > Email: cib...@fusesource.com > Web: http://fusesource.com > CamelOne 2011: http://fusesource.com/camelone2011/ > Twitter: davsclaus > Blog: http://davsclaus.blogspot.com/ > Author of Camel in Action: http://www.manning.com/ibsen/ >