Amazon Simple Email Service


import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.simpleemail.AmazonSimpleEmailService;
import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient;
import com.amazonaws.services.simpleemail.model.Body;
import com.amazonaws.services.simpleemail.model.Content;
import com.amazonaws.services.simpleemail.model.Destination;
import com.amazonaws.services.simpleemail.model.Message;
import com.amazonaws.services.simpleemail.model.SendEmailRequest;
import java.util.Arrays;

...

// Create the request:
SendEmailRequest req = new SendEmailRequest();
Destination dest = new Destination(
                Arrays.asList(new String[]{"me@host.com"}));
req.setDestination(dest);
req.setSource("me@host.com");
Message message = new Message();
message.setSubject(new Content("Test subject"));
message.setBody(new Body(new Content("Test Body")));
req.setMessage(message);

// Send the email:
AWSCredentials credentials = new BasicAWSCredentials(
                "accessKey", "secretKey");
AmazonSimpleEmailService service = new 
                AmazonSimpleEmailServiceClient(credentials);
service.sendEmail(req);
Posted on Tue Aug 09 13:05:05 EDT 2011 by Subhash Chandran
cloud amazon java aws