Outlook 2016 will not display an Email with a text/html Inline Attachment correctly when sent with camel-mail.
The same email is displayed correctly in other mail clients like apple mail.
I have already tried swapping the content type of the mail itself, as well as the content type of the attachment.
When the content type is set to text/rich the inline attachment will display, but the body of the email ends up as a regular attachment.
If the content type of the email is text/html the body will display correctly, but the attachment ends up as a regular attachment and not inline.
The Processor that adds the attachment:
String emailContent = emailBody.getContent().toString();
byte[] emailContentByte = emailContent
.getBytes("UTF-8");
// add the file as an attachment to the exchange with a text/html format.
exchange.getIn().addAttachment("cid:http-email", new DataHandler(
(DataSource) new ByteArrayDataSource(emailContentByte,
"text/html")));
The camel smtp endpoint and headers:
.setHeader("contentType", constant("text/html"))
.process(new AttachmentBuilder())
.to("velocity:{{mail.template}}?encoding=UTF-8")
//send the exchange to the specified email address.
.toD("smtp://{{mail.smtp.host}}:{{mail.smtp.port}}"
+ "?from={{mail.smtp.from}}"
+ "&to={{mail.smtp.to}}"
+ "&useInlineAttachments=true")