- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
SendBounceCommand
Generates and sends a bounce message to the sender of an email you received through Amazon SES. You can only use this operation on an email up to 24 hours after you receive it.
You cannot use this operation to send generic bounces for mail that was not received by Amazon SES.
For information about receiving email through Amazon SES, see the Amazon SES Developer Guide .
You can execute this operation no more than once per second.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { SESClient, SendBounceCommand } from "@aws-sdk/client-ses"; // ES Modules import
// const { SESClient, SendBounceCommand } = require("@aws-sdk/client-ses"); // CommonJS import
const client = new SESClient(config);
const input = { // SendBounceRequest
OriginalMessageId: "STRING_VALUE", // required
BounceSender: "STRING_VALUE", // required
Explanation: "STRING_VALUE",
MessageDsn: { // MessageDsn
ReportingMta: "STRING_VALUE", // required
ArrivalDate: new Date("TIMESTAMP"),
ExtensionFields: [ // ExtensionFieldList
{ // ExtensionField
Name: "STRING_VALUE", // required
Value: "STRING_VALUE", // required
},
],
},
BouncedRecipientInfoList: [ // BouncedRecipientInfoList // required
{ // BouncedRecipientInfo
Recipient: "STRING_VALUE", // required
RecipientArn: "STRING_VALUE",
BounceType: "DoesNotExist" || "MessageTooLarge" || "ExceededQuota" || "ContentRejected" || "Undefined" || "TemporaryFailure",
RecipientDsnFields: { // RecipientDsnFields
FinalRecipient: "STRING_VALUE",
Action: "failed" || "delayed" || "delivered" || "relayed" || "expanded", // required
RemoteMta: "STRING_VALUE",
Status: "STRING_VALUE", // required
DiagnosticCode: "STRING_VALUE",
LastAttemptDate: new Date("TIMESTAMP"),
ExtensionFields: [
{
Name: "STRING_VALUE", // required
Value: "STRING_VALUE", // required
},
],
},
},
],
BounceSenderArn: "STRING_VALUE",
};
const command = new SendBounceCommand(input);
const response = await client.send(command);
// { // SendBounceResponse
// MessageId: "STRING_VALUE",
// };
SendBounceCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
BounceSender Required | string | undefined | The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES. |
BouncedRecipientInfoList Required | BouncedRecipientInfo[] | undefined | A list of recipients of the bounced message, including the information required to create the Delivery Status Notifications (DSNs) for the recipients. You must specify at least one |
OriginalMessageId Required | string | undefined | The message ID of the message to be bounced. |
BounceSenderArn | string | undefined | This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the address in the "From" header of the bounce. For more information about sending authorization, see the Amazon SES Developer Guide . |
Explanation | string | undefined | Human-readable text for the bounce message to explain the failure. If not specified, the text is auto-generated based on the bounced recipient information. |
MessageDsn | MessageDsn | undefined | Message-related DSN fields. If not specified, Amazon SES chooses the values. |
SendBounceCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
MessageId | string | undefined | The message ID of the bounce message. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
MessageRejected | client | Indicates that the action failed, and the message could not be sent. Check the error stack for more information about what caused the error. |
SESServiceException | Base exception class for all service exceptions from SES service. |