Mail Message Content - 6.3

Talend ESB Mediation Developer Guide

Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Design and Development
Talend ESB

Camel uses the message exchange's IN body as the MimeMessage text content. The body is converted to String.class.

Camel copies all of the exchange's IN headers to the MimeMessage headers.

The subject of the MimeMessage can be configured using a header property on the IN message. The code below demonstrates this:

from("direct:a").setHeader("subject", constant(subject))

The same applies for other MimeMessage headers such as recipients, so you can use a header property as To :

Map<String, Object> map = new HashMap<String, Object>();
map.put("To", "");
map.put("From", "");
map.put("Subject", "Camel rocks");

String body = "Hello Jens.\nYes it does.\n\nRegards Joe.";
template.sendBodyAndHeaders("smtp://", body, map);

Starting with Camel 2.11, when using the MailProducer to send the mail to the server, you should be able to get the message id of the MimeMessage using the CamelMailMessageId key from the Camel message header.