Example usage for org.springframework.integration.mail MailHeaders REPLY_TO

List of usage examples for org.springframework.integration.mail MailHeaders REPLY_TO

Introduction

In this page you can find the example usage for org.springframework.integration.mail MailHeaders REPLY_TO.

Prototype

String REPLY_TO

To view the source code for org.springframework.integration.mail MailHeaders REPLY_TO.

Click Source Link

Usage

From source file:org.springframework.integration.mail.transformer.AbstractMailMessageTransformer.java

private Map<String, Object> extractHeaderMapFromMailMessage(javax.mail.Message mailMessage) {
    try {//from   w  w  w. j  av a2 s .c  o m
        Map<String, Object> headers = new HashMap<String, Object>();
        headers.put(MailHeaders.FROM, this.convertToString(mailMessage.getFrom()));
        headers.put(MailHeaders.BCC, this.convertToStringArray(mailMessage.getRecipients(RecipientType.BCC)));
        headers.put(MailHeaders.CC, this.convertToStringArray(mailMessage.getRecipients(RecipientType.CC)));
        headers.put(MailHeaders.TO, this.convertToStringArray(mailMessage.getRecipients(RecipientType.TO)));
        headers.put(MailHeaders.REPLY_TO, this.convertToString(mailMessage.getReplyTo()));
        headers.put(MailHeaders.SUBJECT, mailMessage.getSubject());
        return headers;
    } catch (Exception e) {
        throw new MessagingException("conversion of MailMessage headers failed", e);
    }
}