clients/client-ses/README.md
AWS SDK for JavaScript SES Client for Node.js, Browser and React Native.
<fullname>Amazon Simple Email Service</fullname>
<p> This document contains reference information for the <a href="https://aws.amazon.com/ses/">Amazon Simple Email Service</a> (Amazon SES) API, version 2010-12-01. This document is best used in conjunction with the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/Welcome.html">Amazon SES Developer Guide</a>. </p> <note> <p> For a list of Amazon SES endpoints to use in service requests, see <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html">Regions and Amazon SES</a> in the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/Welcome.html">Amazon SES Developer Guide</a>.</p> </note> <p>This documentation contains reference information related to the following:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/ses/latest/APIReference/API_Operations.html">Amazon SES API Actions</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/ses/latest/APIReference/API_Types.html">Amazon SES API Data Types</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/ses/latest/APIReference/CommonParameters.html">Common Parameters</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/ses/latest/APIReference/CommonErrors.html">Common Errors</a> </p> </li> </ul>To install this package, use the CLI of your favorite package manager:
npm install @aws-sdk/client-sesyarn add @aws-sdk/client-sespnpm add @aws-sdk/client-sesThe AWS SDK is modulized by clients and commands.
To send a request, you only need to import the SESClient and
the commands you need, for example ListIdentitiesCommand:
// ES5 example
const { SESClient, ListIdentitiesCommand } = require("@aws-sdk/client-ses");
// ES6+ example
import { SESClient, ListIdentitiesCommand } from "@aws-sdk/client-ses";
To send a request:
send operation on the client, providing the command object as input.const client = new SESClient({ region: "REGION" });
const params = { /** input parameters */ };
const command = new ListIdentitiesCommand(params);
We recommend using the await operator to wait for the promise returned by send operation as follows:
// async/await.
try {
const data = await client.send(command);
// process data.
} catch (error) {
// error handling.
} finally {
// finally.
}
You can also use Promise chaining.
client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
The aggregated client class is exported from the same package, but without the "Client" suffix.
SES extends SESClient and additionally supports all operations, waiters, and paginators as methods.
This style may be familiar to you from the AWS SDK for JavaScript v2.
If you are bundling the AWS SDK, we recommend using only the bare-bones client (SESClient).
More details are in the blog post on
modular packages in AWS SDK for JavaScript.
import { SES } from "@aws-sdk/client-ses";
const client = new SES({ region: "REGION" });
// async/await.
try {
const data = await client.listIdentities(params);
// process data.
} catch (error) {
// error handling.
}
// Promises.
client
.listIdentities(params)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
});
// callbacks (not recommended).
client.listIdentities(params, (err, data) => {
// process err and data.
});
When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).
try {
const data = await client.send(command);
// process data.
} catch (error) {
const { requestId, cfId, extendedRequestId } = error.$metadata;
console.log({ requestId, cfId, extendedRequestId });
/**
* The keys within exceptions are also parsed.
* You can access them by specifying exception names:
* if (error.name === 'SomeServiceException') {
* const value = error.specialKeyInException;
* }
*/
}
See also docs/ERROR_HANDLING.
Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
aws-sdk-js
on AWS Developer Blog.aws-sdk-js.To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.
This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-ses package is updated.
To contribute to client you can check our generate clients scripts.
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
Command API Reference / Input / Output
</details> <details> <summary> CreateConfigurationSet </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateConfigurationSetEventDestination </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateConfigurationSetTrackingOptions </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateCustomVerificationEmailTemplate </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateReceiptFilter </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateReceiptRule </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateReceiptRuleSet </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateTemplate </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteConfigurationSet </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteConfigurationSetEventDestination </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteConfigurationSetTrackingOptions </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteCustomVerificationEmailTemplate </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteIdentity </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteIdentityPolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteReceiptFilter </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteReceiptRule </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteReceiptRuleSet </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteTemplate </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteVerifiedEmailAddress </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeActiveReceiptRuleSet </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeConfigurationSet </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeReceiptRule </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeReceiptRuleSet </summary>Command API Reference / Input / Output
</details> <details> <summary> GetAccountSendingEnabled </summary>Command API Reference / Input / Output
</details> <details> <summary> GetCustomVerificationEmailTemplate </summary>Command API Reference / Input / Output
</details> <details> <summary> GetIdentityDkimAttributes </summary>Command API Reference / Input / Output
</details> <details> <summary> GetIdentityMailFromDomainAttributes </summary>Command API Reference / Input / Output
</details> <details> <summary> GetIdentityNotificationAttributes </summary>Command API Reference / Input / Output
</details> <details> <summary> GetIdentityPolicies </summary>Command API Reference / Input / Output
</details> <details> <summary> GetIdentityVerificationAttributes </summary>Command API Reference / Input / Output
</details> <details> <summary> GetSendQuota </summary>Command API Reference / Input / Output
</details> <details> <summary> GetSendStatistics </summary>Command API Reference / Input / Output
</details> <details> <summary> GetTemplate </summary>Command API Reference / Input / Output
</details> <details> <summary> ListConfigurationSets </summary>Command API Reference / Input / Output
</details> <details> <summary> ListCustomVerificationEmailTemplates </summary>Command API Reference / Input / Output
</details> <details> <summary> ListIdentities </summary>Command API Reference / Input / Output
</details> <details> <summary> ListIdentityPolicies </summary>Command API Reference / Input / Output
</details> <details> <summary> ListReceiptFilters </summary>Command API Reference / Input / Output
</details> <details> <summary> ListReceiptRuleSets </summary>Command API Reference / Input / Output
</details> <details> <summary> ListTemplates </summary>Command API Reference / Input / Output
</details> <details> <summary> ListVerifiedEmailAddresses </summary>Command API Reference / Input / Output
</details> <details> <summary> PutConfigurationSetDeliveryOptions </summary>Command API Reference / Input / Output
</details> <details> <summary> PutIdentityPolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> ReorderReceiptRuleSet </summary>Command API Reference / Input / Output
</details> <details> <summary> SendBounce </summary>Command API Reference / Input / Output
</details> <details> <summary> SendBulkTemplatedEmail </summary>Command API Reference / Input / Output
</details> <details> <summary> SendCustomVerificationEmail </summary>Command API Reference / Input / Output
</details> <details> <summary> SendEmail </summary>Command API Reference / Input / Output
</details> <details> <summary> SendRawEmail </summary>Command API Reference / Input / Output
</details> <details> <summary> SendTemplatedEmail </summary>Command API Reference / Input / Output
</details> <details> <summary> SetActiveReceiptRuleSet </summary>Command API Reference / Input / Output
</details> <details> <summary> SetIdentityDkimEnabled </summary>Command API Reference / Input / Output
</details> <details> <summary> SetIdentityFeedbackForwardingEnabled </summary>Command API Reference / Input / Output
</details> <details> <summary> SetIdentityHeadersInNotificationsEnabled </summary>Command API Reference / Input / Output
</details> <details> <summary> SetIdentityMailFromDomain </summary>Command API Reference / Input / Output
</details> <details> <summary> SetIdentityNotificationTopic </summary>Command API Reference / Input / Output
</details> <details> <summary> SetReceiptRulePosition </summary>Command API Reference / Input / Output
</details> <details> <summary> TestRenderTemplate </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateAccountSendingEnabled </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateConfigurationSetEventDestination </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateConfigurationSetReputationMetricsEnabled </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateConfigurationSetSendingEnabled </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateConfigurationSetTrackingOptions </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateCustomVerificationEmailTemplate </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateReceiptRule </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateTemplate </summary>Command API Reference / Input / Output
</details> <details> <summary> VerifyDomainDkim </summary>Command API Reference / Input / Output
</details> <details> <summary> VerifyDomainIdentity </summary>Command API Reference / Input / Output
</details> <details> <summary> VerifyEmailAddress </summary> </details> <details> <summary> VerifyEmailIdentity </summary> </details>