List of usage examples for com.amazonaws.services.simpleemail.model Destination setToAddresses
public void setToAddresses(java.util.Collection<String> toAddresses)
The recipients to place on the To: line of the message.
From source file:org.duracloud.mill.notification.SESNotificationManager.java
License:Apache License
@Override public void sendEmail(String subject, String body) { if (ArrayUtils.isEmpty(this.recipientEmailAddresses)) { log.warn("No recipients configured - no one to notify: ignoring..."); return;// w ww . j av a 2 s .c o m } SendEmailRequest email = new SendEmailRequest(); try { Destination destination = new Destination(); destination.setToAddresses(Arrays.asList(this.recipientEmailAddresses)); email.setDestination(destination); email.setSource("notifications@duracloud.org"); Message message = new Message(new Content(subject), new Body(new Content(body))); email.setMessage(message); client.sendEmail(email); log.info("email sent: {}", email); } catch (Exception e) { log.error("failed to send " + email + ": " + e.getMessage(), e); } }