Example usage for com.amazonaws.services.simpleemail.model Destination withBccAddresses

List of usage examples for com.amazonaws.services.simpleemail.model Destination withBccAddresses

Introduction

In this page you can find the example usage for com.amazonaws.services.simpleemail.model Destination withBccAddresses.

Prototype


public Destination withBccAddresses(java.util.Collection<String> bccAddresses) 

Source Link

Document

The recipients to place on the BCC: line of the message.

Usage

From source file:org.springframework.cloud.aws.mail.simplemail.SimpleEmailServiceMailSender.java

License:Apache License

private SendEmailRequest prepareMessage(SimpleMailMessage simpleMailMessage) {
    Destination destination = new Destination();
    destination.withToAddresses(simpleMailMessage.getTo());

    if (simpleMailMessage.getCc() != null) {
        destination.withCcAddresses(simpleMailMessage.getCc());
    }/*from   ww w . j a  v  a2s .  c om*/

    if (simpleMailMessage.getBcc() != null) {
        destination.withBccAddresses(simpleMailMessage.getBcc());
    }

    Content subject = new Content(simpleMailMessage.getSubject());
    Body body = new Body(new Content(simpleMailMessage.getText()));

    SendEmailRequest emailRequest = new SendEmailRequest(simpleMailMessage.getFrom(), destination,
            new Message(subject, body));

    if (StringUtils.hasText(simpleMailMessage.getReplyTo())) {
        emailRequest.withReplyToAddresses(simpleMailMessage.getReplyTo());
    }

    return emailRequest;
}