camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AOladipupo <aina_dip...@yahoo.com>
Subject Re: camel-mail: Body ends up as attachment instead of e-mail body in multipart mail.
Date Thu, 10 Nov 2016 14:13:54 GMT
you need to set the content type as part of the uri options or in the
exchange header (will overite the uri values). See modified section of your
code below:


@Override 
                public void process(Exchange exchange) throws Exception { 
                        Message in = exchange.getIn(); 
                        FileDataSource file = new
javax.activation.FileDataSource("H:\\file.txt"); 
                        in.addAttachment("report.txt", new
DataHandler(file)); 
                        *in.setHeader("contentType", "text/html");*
                        in.setBody("Hello"); 
                } 



--
View this message in context: http://camel.465427.n5.nabble.com/camel-mail-Body-ends-up-as-attachment-instead-of-e-mail-body-in-multipart-mail-tp5789939p5790006.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message