From efe0f1e54de3c645132b637f5ea478eb12755db1 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Tue, 16 Mar 2010 11:11:04 +0000 Subject: [PATCH] INT-1039, Added documentation explaining mail Message headers taking precedence over MailMessage values --- spring-integration-reference/src/mail.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spring-integration-reference/src/mail.xml b/spring-integration-reference/src/mail.xml index ea5cdc99dc..f0c7f8cd9a 100644 --- a/spring-integration-reference/src/mail.xml +++ b/spring-integration-reference/src/mail.xml @@ -14,7 +14,8 @@ MailSendingMessageHandler mailSendingHandler = new MailSendingMessageHandler(mailSender); MailSendingMessageHandler has various mapping strategies that use Spring's MailMessage abstraction. If the received Message's payload is already - a MailMessage instance, it will be sent directly. Therefore, it is generally recommended to precede this + a MailMessage instance, it will be sent directly. + Therefore, it is generally recommended to precede this consumer with a Transformer for non-trivial MailMessage construction requirements. However, a few simple Message mapping strategies are supported out-of-the-box. For example, if the message payload is a byte array, then that will be mapped to an attachment. For simple text-based emails, you can provide a String-based @@ -35,6 +36,11 @@ MailHeaders.FROM MailHeaders.REPLY_TO + + MailHeaders also allows you to override corresponding MailMessage values. + For example: If MailMessage.to is set to 'foo@bar.com' and MailHeaders.TO + Message header is provided it will take precedence and override the corresponding value in MailMessage +