INT-1713 added content-type to Mail Header Enricher

This commit is contained in:
Oleg Zhurakousky
2011-01-20 12:18:14 -05:00
parent 93511fa616
commit c86ad76323
4 changed files with 7 additions and 8 deletions

View File

@@ -17,7 +17,6 @@
package org.springframework.integration.mail;
import javax.mail.MessagingException;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import org.springframework.core.io.ByteArrayResource;

View File

@@ -21,6 +21,7 @@ import org.springframework.integration.mail.MailHeaders;
/**
* @author Mark Fisher
* @author Oleg Zhurakousky
* @since 2.0
*/
public class MailHeaderEnricherParser extends HeaderEnricherParserSupport {
@@ -32,6 +33,7 @@ public class MailHeaderEnricherParser extends HeaderEnricherParserSupport {
this.addElementToHeaderMapping("bcc", MailHeaders.BCC);
this.addElementToHeaderMapping("from", MailHeaders.FROM);
this.addElementToHeaderMapping("reply-to", MailHeaders.REPLY_TO);
this.addElementToHeaderMapping("content-type", MailHeaders.CONTENT_TYPE);
}
}

View File

@@ -257,6 +257,7 @@
<xsd:element name="bcc" type="headerType"/>
<xsd:element name="from" type="headerType"/>
<xsd:element name="reply-to" type="headerType"/>
<xsd:element name="content-type" type="headerType"/>
</xsd:choice>
<xsd:attribute name="default-overwrite">
<xsd:annotation>

View File

@@ -13,14 +13,11 @@
<int:channel id="inputChannel"/>
<int:header-enricher input-channel="inputChannel" output-channel="mailEnricherChannel">
<int:header name="mail_contentType" value="text/html"/>
</int:header-enricher>
<int-mail:header-enricher input-channel="mailEnricherChannel" output-channel="mailChannel">
<int-mail:to value="emailaddress"/>
<int-mail:from value="emailaddress"/>
<int-mail:header-enricher input-channel="inputChannel" output-channel="mailChannel">
<int-mail:to value="mailto"/>
<int-mail:from value="mailfrom"/>
<int-mail:subject value="With Content Type"/>
<int-mail:content-type value="text/html"/>
</int-mail:header-enricher>
<int:channel id="mailChannel"/>