Amazon Simple Email Service

2015/05/07 - Amazon Simple Email Service - 18 new api methods

GetSendQuota (new) Link ¶

Returns the user's current sending limits.

This action is throttled at one request per second.

Request Syntax

client.get_send_quota()
rtype:

dict

returns:

Response Syntax

{
    'Max24HourSend': 123.0,
    'MaxSendRate': 123.0,
    'SentLast24Hours': 123.0
}

Response Structure

  • (dict) --

    Represents the user's current activity limits returned from a successful GetSendQuota request.

    • Max24HourSend (float) --

      The maximum number of emails the user is allowed to send in a 24-hour interval. A value of -1 signifies an unlimited quota.

    • MaxSendRate (float) --

      The maximum number of emails that Amazon SES can accept from the user's account per second.

    • SentLast24Hours (float) --

      The number of emails sent during the previous 24 hours.

VerifyDomainIdentity (new) Link ¶

Verifies a domain.

This action is throttled at one request per second.

Request Syntax

client.verify_domain_identity(
    Domain='string'
)
type Domain:

string

param Domain:

[REQUIRED]

The domain to be verified.

rtype:

dict

returns:

Response Syntax

{
    'VerificationToken': 'string'
}

Response Structure

  • (dict) --

    Represents a token used for domain ownership verification.

    • VerificationToken (string) --

      A TXT record that must be placed in the DNS settings for the domain, in order to complete domain verification.

GetIdentityDkimAttributes (new) Link ¶

Returns the current status of Easy DKIM signing for an entity. For domain name identities, this action also returns the DKIM tokens that are required for Easy DKIM signing, and whether Amazon SES has successfully verified that these tokens have been published.

This action takes a list of identities as input and returns the following information for each:

  • Whether Easy DKIM signing is enabled or disabled.

  • A set of DKIM tokens that represent the identity. If the identity is an email address, the tokens represent the domain of that address.

  • Whether Amazon SES has successfully verified the DKIM tokens published in the domain's DNS. This information is only returned for domain name identities, not for email addresses.

This action is throttled at one request per second and can only get DKIM attributes for up to 100 identities at a time.

For more information about creating DNS records using DKIM tokens, go to the Amazon SES Developer Guide.

Request Syntax

client.get_identity_dkim_attributes(
    Identities=[
        'string',
    ]
)
type Identities:

list

param Identities:

[REQUIRED]

A list of one or more verified identities - email addresses, domains, or both.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'DkimAttributes': {
        'string': {
            'DkimEnabled': True|False,
            'DkimVerificationStatus': 'Pending'|'Success'|'Failed'|'TemporaryFailure'|'NotStarted',
            'DkimTokens': [
                'string',
            ]
        }
    }
}

Response Structure

  • (dict) --

    Represents a list of all the DKIM attributes for the specified identity.

    • DkimAttributes (dict) --

      The DKIM attributes for an email address or a domain.

      • (string) --

        • (dict) --

          Represents the DKIM attributes of a verified email address or a domain.

          • DkimEnabled (boolean) --

            True if DKIM signing is enabled for email sent from the identity; false otherwise.

          • DkimVerificationStatus (string) --

            Describes whether Amazon SES has successfully verified the DKIM DNS records (tokens) published in the domain name's DNS. (This only applies to domain identities, not email address identities.)

          • DkimTokens (list) --

            A set of character strings that represent the domain's identity. Using these tokens, you will need to create DNS CNAME records that point to DKIM public keys hosted by Amazon SES. Amazon Web Services will eventually detect that you have updated your DNS records; this detection process may take up to 72 hours. Upon successful detection, Amazon SES will be able to DKIM-sign email originating from that domain. (This only applies to domain identities, not email address identities.)

            For more information about creating DNS records using DKIM tokens, go to the Amazon SES Developer Guide.

            • (string) --

VerifyEmailAddress (new) Link ¶

Verifies an email address. This action causes a confirmation email message to be sent to the specified address.

This action is throttled at one request per second.

Request Syntax

client.verify_email_address(
    EmailAddress='string'
)
type EmailAddress:

string

param EmailAddress:

[REQUIRED]

The email address to be verified.

returns:

None

GetIdentityVerificationAttributes (new) Link ¶

Given a list of identities (email addresses and/or domains), returns the verification status and (for domain identities) the verification token for each identity.

This action is throttled at one request per second and can only get verification attributes for up to 100 identities at a time.

Request Syntax

client.get_identity_verification_attributes(
    Identities=[
        'string',
    ]
)
type Identities:

list

param Identities:

[REQUIRED]

A list of identities.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'VerificationAttributes': {
        'string': {
            'VerificationStatus': 'Pending'|'Success'|'Failed'|'TemporaryFailure'|'NotStarted',
            'VerificationToken': 'string'
        }
    }
}

Response Structure

  • (dict) --

    Represents the verification attributes for a list of identities.

    • VerificationAttributes (dict) --

      A map of Identities to IdentityVerificationAttributes objects.

      • (string) --

        • (dict) --

          Represents the verification attributes of a single identity.

          • VerificationStatus (string) --

            The verification status of the identity: "Pending", "Success", "Failed", or "TemporaryFailure".

          • VerificationToken (string) --

            The verification token for a domain identity. Null for email address identities.

SetIdentityFeedbackForwardingEnabled (new) Link ¶

Given an identity (email address or domain), enables or disables whether Amazon SES forwards bounce and complaint notifications as email. Feedback forwarding can only be disabled when Amazon Simple Notification Service (Amazon SNS) topics are specified for both bounces and complaints.

This action is throttled at one request per second.

For more information about using notifications with Amazon SES, see the Amazon SES Developer Guide.

Request Syntax

client.set_identity_feedback_forwarding_enabled(
    Identity='string',
    ForwardingEnabled=True|False
)
type Identity:

string

param Identity:

[REQUIRED]

The identity for which to set bounce and complaint notification forwarding. Examples: user@example.com, example.com.

type ForwardingEnabled:

boolean

param ForwardingEnabled:

[REQUIRED]

Sets whether Amazon SES will forward bounce and complaint notifications as email. true specifies that Amazon SES will forward bounce and complaint notifications as email, in addition to any Amazon SNS topic publishing otherwise specified. false specifies that Amazon SES will publish bounce and complaint notifications only through Amazon SNS. This value can only be set to false when Amazon SNS topics are set for both Bounce and Complaint notification types.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

    An empty element. Receiving this element indicates that the request completed successfully.

GetSendStatistics (new) Link ¶

Returns the user's sending statistics. The result is a list of data points, representing the last two weeks of sending activity.

Each data point in the list contains statistics for a 15-minute interval.

This action is throttled at one request per second.

Request Syntax

client.get_send_statistics()
rtype:

dict

returns:

Response Syntax

{
    'SendDataPoints': [
        {
            'Timestamp': datetime(2015, 1, 1),
            'DeliveryAttempts': 123,
            'Bounces': 123,
            'Complaints': 123,
            'Rejects': 123
        },
    ]
}

Response Structure

  • (dict) --

    Represents a list of SendDataPoint items returned from a successful GetSendStatistics request. This list contains aggregated data from the previous two weeks of sending activity.

    • SendDataPoints (list) --

      A list of data points, each of which represents 15 minutes of activity.

      • (dict) --

        Represents sending statistics data. Each SendDataPoint contains statistics for a 15-minute period of sending activity.

        • Timestamp (datetime) --

          Time of the data point.

        • DeliveryAttempts (integer) --

          Number of emails that have been enqueued for sending.

        • Bounces (integer) --

          Number of emails that have bounced.

        • Complaints (integer) --

          Number of unwanted emails that were rejected by recipients.

        • Rejects (integer) --

          Number of emails rejected by Amazon SES.

DeleteIdentity (new) Link ¶

Deletes the specified identity (email address or domain) from the list of verified identities.

This action is throttled at one request per second.

Request Syntax

client.delete_identity(
    Identity='string'
)
type Identity:

string

param Identity:

[REQUIRED]

The identity to be removed from the list of identities for the AWS Account.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

    An empty element. Receiving this element indicates that the request completed successfully.

ListIdentities (new) Link ¶

Returns a list containing all of the identities (email addresses and domains) for a specific AWS Account, regardless of verification status.

This action is throttled at one request per second.

Request Syntax

client.list_identities(
    IdentityType='EmailAddress'|'Domain',
    NextToken='string',
    MaxItems=123
)
type IdentityType:

string

param IdentityType:

The type of the identities to list. Possible values are "EmailAddress" and "Domain". If this parameter is omitted, then all identities will be listed.

type NextToken:

string

param NextToken:

The token to use for pagination.

type MaxItems:

integer

param MaxItems:

The maximum number of identities per page. Possible values are 1-1000 inclusive.

rtype:

dict

returns:

Response Syntax

{
    'Identities': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents a list of all verified identities for the AWS Account.

    • Identities (list) --

      A list of identities.

      • (string) --

    • NextToken (string) --

      The token used for pagination.

SendRawEmail (new) Link ¶

Sends an email message, with header and content specified by the client. The SendRawEmail action is useful for sending multipart MIME emails. The raw text of the message must comply with Internet email standards; otherwise, the message cannot be sent.

The total size of the message cannot exceed 10 MB. This includes any attachments that are part of the message.

Amazon SES has a limit on the total number of recipients per message: The combined number of To:, CC: and BCC: email addresses cannot exceed 50. If you need to send an email message to a larger audience, you can divide your recipient list into groups of 50 or fewer, and then call Amazon SES repeatedly to send the message to each group.

The To:, CC:, and BCC: headers in the raw message can contain a group list. Note that each recipient in a group list counts towards the 50-recipient limit.

For every message that you send, the total number of recipients (To:, CC: and BCC:) is counted against your sending quota - the maximum number of emails you can send in a 24-hour period. For information about your sending quota, go to the Amazon SES Developer Guide.

Request Syntax

client.send_raw_email(
    Source='string',
    Destinations=[
        'string',
    ],
    RawMessage={
        'Data': b'bytes'
    }
)
type Source:

string

param Source:

The identity's email address. If you do not provide a value for this parameter, you must specify a "From" address in the raw text of the message. (You can also specify both.)

By default, the string must be 7-bit ASCII. If the text must contain any other characters, then you must use MIME encoded-word syntax (RFC 2047) instead of a literal string. MIME encoded-word syntax uses the following form: =?charset?encoding?encoded-text?=. For more information, see RFC 2047.

type Destinations:

list

param Destinations:

A list of destinations for the message, consisting of To:, CC:, and BCC: addresses.

  • (string) --

type RawMessage:

dict

param RawMessage:

[REQUIRED]

The raw text of the message. The client is responsible for ensuring the following:

  • Message must contain a header and a body, separated by a blank line.

  • All required header fields must be present.

  • Each part of a multipart MIME message must be formatted properly.

  • MIME content types must be among those supported by Amazon SES. For more information, go to the Amazon SES Developer Guide.

  • Content must be base64-encoded, if MIME requires it.

  • Data (bytes) -- [REQUIRED]

    The raw data of the message. The client must ensure that the message format complies with Internet email standards regarding email header fields, MIME types, MIME encoding, and base64 encoding (if necessary).

    The To:, CC:, and BCC: headers in the raw message can contain a group list.

    For more information, go to the Amazon SES Developer Guide.

rtype:

dict

returns:

Response Syntax

{
    'MessageId': 'string'
}

Response Structure

  • (dict) --

    Represents a unique message ID returned from a successful SendRawEmail request.

    • MessageId (string) --

      The unique message identifier returned from the SendRawEmail action.

DeleteVerifiedEmailAddress (new) Link ¶

Deletes the specified email address from the list of verified addresses.

This action is throttled at one request per second.

Request Syntax

client.delete_verified_email_address(
    EmailAddress='string'
)
type EmailAddress:

string

param EmailAddress:

[REQUIRED]

An email address to be removed from the list of verified addresses.

returns:

None

SetIdentityDkimEnabled (new) Link ¶

Enables or disables Easy DKIM signing of email sent from an identity:

  • If Easy DKIM signing is enabled for a domain name identity (e.g., example.com), then Amazon SES will DKIM-sign all email sent by addresses under that domain name (e.g., user@example.com).

  • If Easy DKIM signing is enabled for an email address, then Amazon SES will DKIM-sign all email sent by that email address.

For email addresses (e.g., user@example.com), you can only enable Easy DKIM signing if the corresponding domain (e.g., example.com) has been set up for Easy DKIM using the AWS Console or the VerifyDomainDkim action.

This action is throttled at one request per second.

For more information about Easy DKIM signing, go to the Amazon SES Developer Guide.

Request Syntax

client.set_identity_dkim_enabled(
    Identity='string',
    DkimEnabled=True|False
)
type Identity:

string

param Identity:

[REQUIRED]

The identity for which DKIM signing should be enabled or disabled.

type DkimEnabled:

boolean

param DkimEnabled:

[REQUIRED]

Sets whether DKIM signing is enabled for an identity. Set to true to enable DKIM signing for this identity; false to disable it.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

    An empty element. Receiving this element indicates that the request completed successfully.

SetIdentityNotificationTopic (new) Link ¶

Given an identity (email address or domain), sets the Amazon Simple Notification Service (Amazon SNS) topic to which Amazon SES will publish bounce, complaint, and/or delivery notifications for emails sent with that identity as the Source.

This action is throttled at one request per second.

For more information about feedback notification, see the Amazon SES Developer Guide.

Request Syntax

client.set_identity_notification_topic(
    Identity='string',
    NotificationType='Bounce'|'Complaint'|'Delivery',
    SnsTopic='string'
)
type Identity:

string

param Identity:

[REQUIRED]

The identity for which the Amazon SNS topic will be set. Examples: user@example.com, example.com.

type NotificationType:

string

param NotificationType:

[REQUIRED]

The type of notifications that will be published to the specified Amazon SNS topic.

type SnsTopic:

string

param SnsTopic:

The Amazon Resource Name (ARN) of the Amazon SNS topic. If the parameter is omitted from the request or a null value is passed, SnsTopic is cleared and publishing is disabled.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

    An empty element. Receiving this element indicates that the request completed successfully.

SendEmail (new) Link ¶

Composes an email message based on input data, and then immediately queues the message for sending.

The total size of the message cannot exceed 10 MB.

Amazon SES has a limit on the total number of recipients per message: The combined number of To:, CC: and BCC: email addresses cannot exceed 50. If you need to send an email message to a larger audience, you can divide your recipient list into groups of 50 or fewer, and then call Amazon SES repeatedly to send the message to each group.

For every message that you send, the total number of recipients (To:, CC: and BCC:) is counted against your sending quota - the maximum number of emails you can send in a 24-hour period. For information about your sending quota, go to the Amazon SES Developer Guide.

Request Syntax

client.send_email(
    Source='string',
    Destination={
        'ToAddresses': [
            'string',
        ],
        'CcAddresses': [
            'string',
        ],
        'BccAddresses': [
            'string',
        ]
    },
    Message={
        'Subject': {
            'Data': 'string',
            'Charset': 'string'
        },
        'Body': {
            'Text': {
                'Data': 'string',
                'Charset': 'string'
            },
            'Html': {
                'Data': 'string',
                'Charset': 'string'
            }
        }
    },
    ReplyToAddresses=[
        'string',
    ],
    ReturnPath='string'
)
type Source:

string

param Source:

[REQUIRED]

The identity's email address.

By default, the string must be 7-bit ASCII. If the text must contain any other characters, then you must use MIME encoded-word syntax (RFC 2047) instead of a literal string. MIME encoded-word syntax uses the following form: =?charset?encoding?encoded-text?=. For more information, see RFC 2047.

type Destination:

dict

param Destination:

[REQUIRED]

The destination for this email, composed of To:, CC:, and BCC: fields.

  • ToAddresses (list) --

    The To: field(s) of the message.

    • (string) --

  • CcAddresses (list) --

    The CC: field(s) of the message.

    • (string) --

  • BccAddresses (list) --

    The BCC: field(s) of the message.

    • (string) --

type Message:

dict

param Message:

[REQUIRED]

The message to be sent.

  • Subject (dict) -- [REQUIRED]

    The subject of the message: A short summary of the content, which will appear in the recipient's inbox.

    • Data (string) -- [REQUIRED]

      The textual data of the content.

    • Charset (string) --

      The character set of the content.

  • Body (dict) -- [REQUIRED]

    The message body.

    • Text (dict) --

      The content of the message, in text format. Use this for text-based email clients, or clients on high-latency networks (such as mobile devices).

      • Data (string) -- [REQUIRED]

        The textual data of the content.

      • Charset (string) --

        The character set of the content.

    • Html (dict) --

      The content of the message, in HTML format. Use this for email clients that can process HTML. You can include clickable links, formatted text, and much more in an HTML message.

      • Data (string) -- [REQUIRED]

        The textual data of the content.

      • Charset (string) --

        The character set of the content.

type ReplyToAddresses:

list

param ReplyToAddresses:

The reply-to email address(es) for the message. If the recipient replies to the message, each reply-to address will receive the reply.

  • (string) --

type ReturnPath:

string

param ReturnPath:

The email address to which bounces and complaints are to be forwarded when feedback forwarding is enabled. If the message cannot be delivered to the recipient, then an error message will be returned from the recipient's ISP; this message will then be forwarded to the email address specified by the ReturnPath parameter. The ReturnPath parameter is never overwritten. This email address must be either individually verified with Amazon SES, or from a domain that has been verified with Amazon SES.

rtype:

dict

returns:

Response Syntax

{
    'MessageId': 'string'
}

Response Structure

  • (dict) --

    Represents a unique message ID returned from a successful SendEmail request.

    • MessageId (string) --

      The unique message identifier returned from the SendEmail action.

VerifyDomainDkim (new) Link ¶

Returns a set of DKIM tokens for a domain. DKIM tokens are character strings that represent your domain's identity. Using these tokens, you will need to create DNS CNAME records that point to DKIM public keys hosted by Amazon SES. Amazon Web Services will eventually detect that you have updated your DNS records; this detection process may take up to 72 hours. Upon successful detection, Amazon SES will be able to DKIM-sign email originating from that domain.

This action is throttled at one request per second.

To enable or disable Easy DKIM signing for a domain, use the SetIdentityDkimEnabled action.

For more information about creating DNS records using DKIM tokens, go to the Amazon SES Developer Guide.

Request Syntax

client.verify_domain_dkim(
    Domain='string'
)
type Domain:

string

param Domain:

[REQUIRED]

The name of the domain to be verified for Easy DKIM signing.

rtype:

dict

returns:

Response Syntax

{
    'DkimTokens': [
        'string',
    ]
}

Response Structure

  • (dict) --

    Represents the DNS records that must be published in the domain name's DNS to complete DKIM setup.

    • DkimTokens (list) --

      A set of character strings that represent the domain's identity. If the identity is an email address, the tokens represent the domain of that address.

      Using these tokens, you will need to create DNS CNAME records that point to DKIM public keys hosted by Amazon SES. Amazon Web Services will eventually detect that you have updated your DNS records; this detection process may take up to 72 hours. Upon successful detection, Amazon SES will be able to DKIM-sign emails originating from that domain.

      For more information about creating DNS records using DKIM tokens, go to the Amazon SES Developer Guide.

      • (string) --

ListVerifiedEmailAddresses (new) Link ¶

Returns a list containing all of the email addresses that have been verified.

This action is throttled at one request per second.

Request Syntax

client.list_verified_email_addresses()
rtype:

dict

returns:

Response Syntax

{
    'VerifiedEmailAddresses': [
        'string',
    ]
}

Response Structure

  • (dict) --

    Represents a list of all the email addresses verified for the current user.

    • VerifiedEmailAddresses (list) --

      A list of email addresses that have been verified.

      • (string) --

VerifyEmailIdentity (new) Link ¶

Verifies an email address. This action causes a confirmation email message to be sent to the specified address.

This action is throttled at one request per second.

Request Syntax

client.verify_email_identity(
    EmailAddress='string'
)
type EmailAddress:

string

param EmailAddress:

[REQUIRED]

The email address to be verified.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

    An empty element. Receiving this element indicates that the request completed successfully.

GetIdentityNotificationAttributes (new) Link ¶

Given a list of verified identities (email addresses and/or domains), returns a structure describing identity notification attributes.

This action is throttled at one request per second and can only get notification attributes for up to 100 identities at a time.

For more information about using notifications with Amazon SES, see the Amazon SES Developer Guide.

Request Syntax

client.get_identity_notification_attributes(
    Identities=[
        'string',
    ]
)
type Identities:

list

param Identities:

[REQUIRED]

A list of one or more identities.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'NotificationAttributes': {
        'string': {
            'BounceTopic': 'string',
            'ComplaintTopic': 'string',
            'DeliveryTopic': 'string',
            'ForwardingEnabled': True|False
        }
    }
}

Response Structure

  • (dict) --

    Describes whether an identity has Amazon Simple Notification Service (Amazon SNS) topics set for bounce, complaint, and/or delivery notifications, and specifies whether feedback forwarding is enabled for bounce and complaint notifications.

    • NotificationAttributes (dict) --

      A map of Identity to IdentityNotificationAttributes.

      • (string) --

        • (dict) --

          Represents the notification attributes of an identity, including whether an identity has Amazon Simple Notification Service (Amazon SNS) topics set for bounce, complaint, and/or delivery notifications, and whether feedback forwarding is enabled for bounce and complaint notifications.

          • BounceTopic (string) --

            The Amazon Resource Name (ARN) of the Amazon SNS topic where Amazon SES will publish bounce notifications.

          • ComplaintTopic (string) --

            The Amazon Resource Name (ARN) of the Amazon SNS topic where Amazon SES will publish complaint notifications.

          • DeliveryTopic (string) --

            The Amazon Resource Name (ARN) of the Amazon SNS topic where Amazon SES will publish delivery notifications.

          • ForwardingEnabled (boolean) --

            Describes whether Amazon SES will forward bounce and complaint notifications as email. true indicates that Amazon SES will forward bounce and complaint notifications as email, while false indicates that bounce and complaint notifications will be published only to the specified bounce and complaint Amazon SNS topics.