Mail Message Content - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
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))
   .to("smtp://joe2@localhost");

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", "jenshansen@gmail.com");
map.put("From", "jbloggs@gmail.com");
map.put("Subject", "Camel rocks");

String body = "Hello Jens.\nYes it does.\n\nRegards Joe.";
template.sendBodyAndHeaders("smtp://jenshansen@gmail.com", 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.