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

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

Introduction

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

Prototype

String CC

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

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 ww. j  a va2 s  .c  om
        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);
    }
}