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

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

Introduction

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

Prototype

String BCC

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

Click Source Link

Usage

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

private Map<String, Object> extractHeaderMapFromMailMessage(javax.mail.Message mailMessage) {
    try {//  ww  w . j a  v a2s  . 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);
    }
}