Example usage for com.amazonaws.services.simpleemail.model SendEmailRequest withReplyToAddresses

List of usage examples for com.amazonaws.services.simpleemail.model SendEmailRequest withReplyToAddresses

Introduction

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

Prototype


public SendEmailRequest withReplyToAddresses(java.util.Collection<String> replyToAddresses) 

Source Link

Document

The reply-to email address(es) for 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());
    }//  w w  w  . j  a va  2 s .  c  o m

    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;
}