Apache camel 如何使用驼峰邮件将带有内嵌附件的电子邮件发送到outlook
Outlook 2016在使用驼峰邮件发送时,不会正确显示包含文本/html内联附件的电子邮件 相同的电子邮件在其他邮件客户端(如apple mail)中正确显示 我已经尝试过交换邮件本身的内容类型,以及附件的内容类型 当内容类型设置为text/rich时,将显示内联附件,但电子邮件正文最终将显示为常规附件 如果电子邮件的内容类型为text/html,则正文将正确显示,但附件最终将作为常规附件而不是内联附件 添加附件的处理器:Apache camel 如何使用驼峰邮件将带有内嵌附件的电子邮件发送到outlook,apache-camel,email-attachments,apache-camel-mail,Apache Camel,Email Attachments,Apache Camel Mail,Outlook 2016在使用驼峰邮件发送时,不会正确显示包含文本/html内联附件的电子邮件 相同的电子邮件在其他邮件客户端(如apple mail)中正确显示 我已经尝试过交换邮件本身的内容类型,以及附件的内容类型 当内容类型设置为text/rich时,将显示内联附件,但电子邮件正文最终将显示为常规附件 如果电子邮件的内容类型为text/html,则正文将正确显示,但附件最终将作为常规附件而不是内联附件 添加附件的处理器: String emailContent = emailBody.
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")));
骆驼smtp终结点和标头:
.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")
我认为整个邮件消息的内容类型应该是
内容类型:multipart/related
text/html
将是各个消息部分的内容类型
也许有帮助。这是关于图像的,但重点是周围消息的内容类型 我认为整个邮件消息的内容类型应该是
内容类型:multipart/related
text/html
将是各个消息部分的内容类型
也许有帮助。这是关于图像的,但重点是周围消息的内容类型 我暂时解决了这个问题,通过将内容与电子邮件合并而不是创建内联附件,我觉得这不是一个干净的解决方案。我暂时解决了这个问题,通过将内容与电子邮件合并而不是创建内联附件,我觉得这不是一个干净的解决方案。