Package com.amazonaws.services.simpleemail.model

Examples of com.amazonaws.services.simpleemail.model.SendEmailRequest


            internalSendEmail(to, from, replyTo, subject, htmlBody, textBody);
        }
    }

    private String internalSendEmail(String to, String from, String replyTo, String subject, String htmlBody, String textBody) {
        SendEmailRequest request = new SendEmailRequest().
                withSource(from).
                withReplyToAddresses(replyTo);

        List<String> toAddresses = new ArrayList<>();
        toAddresses.add(to);

        Destination dest = new Destination().withToAddresses(toAddresses);
        request.setDestination(dest);

        Content subjContent = new Content().withData(subject);
        Message msg = new Message().withSubject(subjContent);

        // Include a body in both text and HTML formats
        Body theBody = new Body();
        if (textBody != null) {
            theBody.withText(new Content().withData(textBody));
        }
        if (htmlBody != null) {
            theBody.withHtml(new Content().withData(htmlBody));
        }
        msg.setBody(theBody);

        request.setMessage(msg);

        // Call Amazon SES to send the message
        String messageId = null;
        try {
            SendEmailResult result = simpleEmailServiceClient.sendEmail(request);
View Full Code Here


        // Create a message with the specified subject and body.
        Message message = new Message().withSubject(subject).withBody(body);

        // Assemble the email.
        SendEmailRequest request = new SendEmailRequest().withSource(FROM).withDestination(destination).withMessage(message);

        try {
            System.out.println("Attempting to send an email through Amazon SES by using the AWS SDK for Java...");

            /*
 
View Full Code Here

        Content bodyContent = new Content();
        Body msgBody = new Body(bodyContent);
        msgBody.setHtml(new Content(body));
        Message msg = new Message(subjectContent, msgBody);
        String sourceAddress = getSourceAddress(to);
        SendEmailRequest request = new SendEmailRequest(sourceAddress, destination, msg);
        request.setReturnPath(sourceAddress);
        LOGGER.debug(String.format("Sending email with subject '%s' to %s",
                subject, to));
        SendEmailResult result = null;
        try {
            result = sesClient.sendEmail(request);
View Full Code Here

  }

  @Override
  public boolean sendEmail(List<String> emails, String subject, String body) {
    if (emails != null && !emails.isEmpty() && !StringUtils.isBlank(body)) {
      final SendEmailRequest request = new SendEmailRequest().withSource(Config.SUPPORT_EMAIL);
      Destination dest = new Destination().withToAddresses(emails);
      request.setDestination(dest);

      Content subjContent = new Content().withData(subject);
      Message msg = new Message().withSubject(subjContent);

      // Include a body in both text and HTML formats
      Content textContent = new Content().withData(body);
      msg.setBody(new Body().withText(textContent));

      request.setMessage(msg);

      Utils.asyncExecute(new Runnable() {
        public void run() {
          sesclient.sendEmail(request);
        }
View Full Code Here

        final Content subjectContent = new Content(subject);
        final Content bodyContent = new Content(body);
        final Body msgBody = new Body(bodyContent);
        final Message msg = new Message(subjectContent, msgBody);

        final SendEmailRequest request = new SendEmailRequest(sender, destination, msg);

        return sesClient.sendEmail(request);
    }
View Full Code Here

  }

  @Override
  public boolean sendEmail(List<String> emails, String subject, String body) {
    if (emails != null && !emails.isEmpty() && !StringUtils.isBlank(body)) {
      final SendEmailRequest request = new SendEmailRequest().withSource(Config.SUPPORT_EMAIL);
      Destination dest = new Destination().withToAddresses(emails);
      request.setDestination(dest);

      Content subjContent = new Content().withData(subject);
      Message msg = new Message().withSubject(subjContent);

      // Include a body in both text and HTML formats
      Content textContent = new Content().withData(body);
      msg.setBody(new Body().withText(textContent));

      request.setMessage(msg);

      Utils.asyncExecute(new Callable<Object>() {
        public Object call() throws Exception {
          return sesclient.sendEmail(request);
        }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpleemail.model.SendEmailRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.