AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
There are several important points to know about SendEmail:
Namespace: Amazon.SimpleEmail
Assembly: AWSSDK.dll
Version: (assembly version)
public virtual SendEmailResponse SendEmail( SendEmailRequest request )
Container for the necessary parameters to execute the SendEmail service method.
| Exception | Condition |
|---|---|
| MessageRejectedException | Indicates that the action failed, and the message could not be sent. Check the error stack for more information about what caused the error. |
This example shows how to send an email.
var sesClient = new AmazonSimpleEmailServiceClient();
var dest = new Destination
{
ToAddresses = new List<string>() { "janedoe@example.com" },
CcAddresses = new List<string>() { "richarddoe@example.com" }
};
var from = "johndoe@example.com";
var subject = new Content("You're invited to the meeting");
var body = new Body(new Content("Please join us Monday at 7:00 PM."));
var msg = new Message(subject, body);
var request = new SendEmailRequest
{
Destination = dest,
Message = msg,
Source = from
};
sesClient.SendEmail(request);
.NET Framework:
Supported in: 4.5, 4.0, 3.5