LinuxCommandLibrary

aws-ses

Send emails via Amazon Simple Email Service

TLDR

Create a new receipt rule set

$ aws ses create-receipt-rule-set --rule-set-name [rule_set_name] --generate-cli-skeleton
copy

Describe the active receipt rule set
$ aws ses describe-active-receipt-rule-set --generate-cli-skeleton
copy

Describe a specific receipt rule
$ aws ses describe-receipt-rule --rule-set-name [rule_set_name] --rule-name [rule_name] --generate-cli-skeleton
copy

List all receipt rule sets
$ aws ses list-receipt-rule-sets --starting-token [token_string] --max-items [integer] --generate-cli-skeleton
copy

Delete a specific receipt rule set (the currently active rule set cannot be deleted)
$ aws ses delete-receipt-rule-set --rule-set-name [rule_set_name] --generate-cli-skeleton
copy

Delete a specific receipt rule
$ aws ses delete-receipt-rule --rule-set-name [rule_set_name] --rule-name [rule_name] --generate-cli-skeleton
copy

Send an email
$ aws ses send-email --from [from_address] --destination "ToAddresses=[addresses]" --message "Subject={Data=[subject_text],Charset=utf8},Body={Text={Data=[body_text],Charset=utf8},Html={Data=[message_body_containing_html],Charset=utf8]"
copy

Display help for a specific SES subcommand
$ aws ses [subcommand] help
copy

SYNOPSIS

aws ses [global-options] COMMAND [subcommand-args]

PARAMETERS

--debug
    Enable debug logging.

--endpoint-url
    Override default endpoint URL.

--no-verify-ssl
    Disable SSL certificate verification.

--cli-read-timeout
    Maximum client read timeout in seconds.

--cli-connect-timeout
    Maximum client connect timeout in seconds.

--output
    Output format: json|text|table.

--query
    JMESPath expression to filter output.

--profile
    Use specific profile from credentials file.

--region
    AWS region (e.g., us-east-1).

--version
    Show version and exit.

--help
    Show help for command.

--color
    Control colored output: on|off|auto.

--no-sign-request
    Do not sign the request.

--ca-bundle
    Custom CA bundle path.

--cli-binary-format
    Binary format: raw-in-base64-out|base64|raw-in|base64-out.

DESCRIPTION

The aws ses command is part of the AWS Command Line Interface (CLI), a toolset for managing AWS services from the Linux terminal. Amazon Simple Email Service (SES) enables scalable email sending, receiving, and tracking for applications.

Key capabilities include verifying sender identities (verify-email-identity, verify-domain-identity), sending emails (send-email, send-templated-email), managing templates, monitoring bounces/complaints (list-bounces), configuring receipts, and handling quotas/suppression lists.

Usage requires AWS CLI installation, credentials via aws configure, and appropriate IAM permissions. SES accounts start in sandbox mode, restricting recipients to verified addresses until production access is requested. Ideal for automating transactional emails in scripts, DevOps pipelines, or bulk campaigns.

Supports JSON/text outputs, querying with JMESPath, and pagination for large lists. Integrates with other AWS services like Lambda for serverless workflows.

CAVEATS

Requires AWS credentials and IAM permissions for SES. Sandbox mode limits unverified recipients. High-volume sending needs production access request. Rate limits apply per region.

INSTALLATION

Install AWS CLI v2: curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip", unzip, and ./aws/install.

CONFIGURATION

Run aws configure to set access key, secret key, region, and output format.

KEY SUBCOMMANDS

send-email, verify-email-identity, list-identities, get-send-quota, send-templated-email.

HISTORY

AWS SES launched in 2011. aws ses subcommands added in AWS CLI v1 (2013). Enhanced with v2 CLI (2020) for better performance, supporting new SES features like configuration sets and dedicated IP pools.

SEE ALSO

aws(1), sendmail(8), mail(1), mutt(1), curl(1)

Copied to clipboard