Table of Contents
SES.Client¶A low-level client representing Amazon Simple Email Service (SES):
client = session.create_client('ses')
These are the available methods:
can_paginate()clone_receipt_rule_set()create_configuration_set()create_configuration_set_event_destination()create_receipt_filter()create_receipt_rule()create_receipt_rule_set()delete_configuration_set()delete_configuration_set_event_destination()delete_identity()delete_identity_policy()delete_receipt_filter()delete_receipt_rule()delete_receipt_rule_set()delete_verified_email_address()describe_active_receipt_rule_set()describe_configuration_set()describe_receipt_rule()describe_receipt_rule_set()generate_presigned_url()get_identity_dkim_attributes()get_identity_mail_from_domain_attributes()get_identity_notification_attributes()get_identity_policies()get_identity_verification_attributes()get_paginator()get_send_quota()get_send_statistics()get_waiter()list_configuration_sets()list_identities()list_identity_policies()list_receipt_filters()list_receipt_rule_sets()list_verified_email_addresses()put_identity_policy()reorder_receipt_rule_set()send_bounce()send_email()send_raw_email()set_active_receipt_rule_set()set_identity_dkim_enabled()set_identity_feedback_forwarding_enabled()set_identity_headers_in_notifications_enabled()set_identity_mail_from_domain()set_identity_notification_topic()set_receipt_rule_position()update_configuration_set_event_destination()update_receipt_rule()verify_domain_dkim()verify_domain_identity()verify_email_address()verify_email_identity()can_paginate(operation_name)¶Check if an operation can be paginated.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Returns: | True if the operation can be paginated,
False otherwise. |
clone_receipt_rule_set(**kwargs)¶Creates a receipt rule set by cloning an existing one. All receipt rules and configurations are copied to the new receipt rule set and are completely independent of the source rule set.
For information about setting up rule sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.clone_receipt_rule_set(
RuleSetName='string',
OriginalRuleSetName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example creates a receipt rule set by cloning an existing one:
response = client.clone_receipt_rule_set(
OriginalRuleSetName='RuleSetToClone',
RuleSetName='RuleSetToCreate',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
create_configuration_set(**kwargs)¶Creates a configuration set.
Configuration sets enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.create_configuration_set(
ConfigurationSet={
'Name': 'string'
}
)
| Parameters: | ConfigurationSet (dict) – [REQUIRED] A data structure that contains the name of the configuration set.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
create_configuration_set_event_destination(**kwargs)¶Creates a configuration set event destination.
Note
When you create or update an event destination, you must provide one, and only one, destination. The destination can be Amazon CloudWatch, Amazon Kinesis Firehose, or Amazon Simple Notification Service (Amazon SNS).
An event destination is the AWS service to which Amazon SES publishes the email sending events associated with a configuration set. For information about using configuration sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.create_configuration_set_event_destination(
ConfigurationSetName='string',
EventDestination={
'Name': 'string',
'Enabled': True|False,
'MatchingEventTypes': [
'send'|'reject'|'bounce'|'complaint'|'delivery'|'open'|'click',
],
'KinesisFirehoseDestination': {
'IAMRoleARN': 'string',
'DeliveryStreamARN': 'string'
},
'CloudWatchDestination': {
'DimensionConfigurations': [
{
'DimensionName': 'string',
'DimensionValueSource': 'messageTag'|'emailHeader'|'linkTag',
'DefaultDimensionValue': 'string'
},
]
},
'SNSDestination': {
'TopicARN': 'string'
}
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
create_receipt_filter(**kwargs)¶Creates a new IP address filter.
For information about setting up IP address filters, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.create_receipt_filter(
Filter={
'Name': 'string',
'IpFilter': {
'Policy': 'Block'|'Allow',
'Cidr': 'string'
}
}
)
| Parameters: | Filter (dict) – [REQUIRED] A data structure that describes the IP address filter to create, which consists of a name, an IP address range, and whether to allow or block mail from it.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
Examples
The following example creates a new IP address filter:
response = client.create_receipt_filter(
Filter={
'IpFilter': {
'Cidr': '1.2.3.4/24',
'Policy': 'Allow',
},
'Name': 'MyFilter',
},
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
create_receipt_rule(**kwargs)¶Creates a receipt rule.
For information about setting up receipt rules, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.create_receipt_rule(
RuleSetName='string',
After='string',
Rule={
'Name': 'string',
'Enabled': True|False,
'TlsPolicy': 'Require'|'Optional',
'Recipients': [
'string',
],
'Actions': [
{
'S3Action': {
'TopicArn': 'string',
'BucketName': 'string',
'ObjectKeyPrefix': 'string',
'KmsKeyArn': 'string'
},
'BounceAction': {
'TopicArn': 'string',
'SmtpReplyCode': 'string',
'StatusCode': 'string',
'Message': 'string',
'Sender': 'string'
},
'WorkmailAction': {
'TopicArn': 'string',
'OrganizationArn': 'string'
},
'LambdaAction': {
'TopicArn': 'string',
'FunctionArn': 'string',
'InvocationType': 'Event'|'RequestResponse'
},
'StopAction': {
'Scope': 'RuleSet',
'TopicArn': 'string'
},
'AddHeaderAction': {
'HeaderName': 'string',
'HeaderValue': 'string'
},
'SNSAction': {
'TopicArn': 'string',
'Encoding': 'UTF-8'|'Base64'
}
},
],
'ScanEnabled': True|False
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example creates a new receipt rule:
response = client.create_receipt_rule(
After='',
Rule={
'Actions': [
{
'S3Action': {
'BucketName': 'MyBucket',
'ObjectKeyPrefix': 'email',
},
},
],
'Enabled': True,
'Name': 'MyRule',
'ScanEnabled': True,
'TlsPolicy': 'Optional',
},
RuleSetName='MyRuleSet',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
create_receipt_rule_set(**kwargs)¶Creates an empty receipt rule set.
For information about setting up receipt rule sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.create_receipt_rule_set(
RuleSetName='string'
)
| Parameters: | RuleSetName (string) – [REQUIRED] The name of the rule set to create. The name must:
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
Examples
The following example creates an empty receipt rule set:
response = client.create_receipt_rule_set(
RuleSetName='MyRuleSet',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_configuration_set(**kwargs)¶Deletes a configuration set.
Configuration sets enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.delete_configuration_set(
ConfigurationSetName='string'
)
| Parameters: | ConfigurationSetName (string) – [REQUIRED] The name of the configuration set to delete. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
delete_configuration_set_event_destination(**kwargs)¶Deletes a configuration set event destination.
Configuration set event destinations are associated with configuration sets, which enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.delete_configuration_set_event_destination(
ConfigurationSetName='string',
EventDestinationName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
delete_identity(**kwargs)¶Deletes the specified identity (an email address or a domain) from the list of verified identities.
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.delete_identity(
Identity='string'
)
| Parameters: | Identity (string) – [REQUIRED] The identity to be removed from the list of identities for the AWS Account. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
Examples
The following example deletes an identity from the list of identities that have been submitted for verification with Amazon SES:
response = client.delete_identity(
Identity='user@example.com',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_identity_policy(**kwargs)¶Deletes the specified sending authorization policy for the given identity (an email address or a domain). This API returns successfully even if a policy with the specified name does not exist.
Note
This API is for the identity owner only. If you have not verified the identity, this API will return an error.
Sending authorization is a feature that enables an identity owner to authorize other senders to use its identities. For information about using sending authorization, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.delete_identity_policy(
Identity='string',
PolicyName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example deletes a sending authorization policy for an identity:
response = client.delete_identity_policy(
Identity='user@example.com',
PolicyName='MyPolicy',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_receipt_filter(**kwargs)¶Deletes the specified IP address filter.
For information about managing IP address filters, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.delete_receipt_filter(
FilterName='string'
)
| Parameters: | FilterName (string) – [REQUIRED] The name of the IP address filter to delete. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
Examples
The following example deletes an IP address filter:
response = client.delete_receipt_filter(
FilterName='MyFilter',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_receipt_rule(**kwargs)¶Deletes the specified receipt rule.
For information about managing receipt rules, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.delete_receipt_rule(
RuleSetName='string',
RuleName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example deletes a receipt rule:
response = client.delete_receipt_rule(
RuleName='MyRule',
RuleSetName='MyRuleSet',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_receipt_rule_set(**kwargs)¶Deletes the specified receipt rule set and all of the receipt rules it contains.
Note
The currently active rule set cannot be deleted.
For information about managing receipt rule sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.delete_receipt_rule_set(
RuleSetName='string'
)
| Parameters: | RuleSetName (string) – [REQUIRED] The name of the receipt rule set to delete. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
Examples
The following example deletes a receipt rule set:
response = client.delete_receipt_rule_set(
RuleSetName='MyRuleSet',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_verified_email_address(**kwargs)¶Deletes the specified email address from the list of verified addresses.
Warning
The DeleteVerifiedEmailAddress action is deprecated as of the May 15, 2012 release of Domain Verification. The DeleteIdentity action is now preferred.
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.delete_verified_email_address(
EmailAddress='string'
)
| Parameters: | EmailAddress (string) – [REQUIRED] An email address to be removed from the list of verified addresses. |
|---|---|
| Returns: | None |
Examples
The following example deletes an email address from the list of identities that have been submitted for verification with Amazon SES:
response = client.delete_verified_email_address(
EmailAddress='user@example.com',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
describe_active_receipt_rule_set()¶Returns the metadata and receipt rules for the receipt rule set that is currently active.
For information about setting up receipt rule sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.describe_active_receipt_rule_set()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'Metadata': {
'Name': 'string',
'CreatedTimestamp': datetime(2015, 1, 1)
},
'Rules': [
{
'Name': 'string',
'Enabled': True|False,
'TlsPolicy': 'Require'|'Optional',
'Recipients': [
'string',
],
'Actions': [
{
'S3Action': {
'TopicArn': 'string',
'BucketName': 'string',
'ObjectKeyPrefix': 'string',
'KmsKeyArn': 'string'
},
'BounceAction': {
'TopicArn': 'string',
'SmtpReplyCode': 'string',
'StatusCode': 'string',
'Message': 'string',
'Sender': 'string'
},
'WorkmailAction': {
'TopicArn': 'string',
'OrganizationArn': 'string'
},
'LambdaAction': {
'TopicArn': 'string',
'FunctionArn': 'string',
'InvocationType': 'Event'|'RequestResponse'
},
'StopAction': {
'Scope': 'RuleSet',
'TopicArn': 'string'
},
'AddHeaderAction': {
'HeaderName': 'string',
'HeaderValue': 'string'
},
'SNSAction': {
'TopicArn': 'string',
'Encoding': 'UTF-8'|'Base64'
}
},
],
'ScanEnabled': True|False
},
]
}
Response Structure
|
Examples
The following example returns the metadata and receipt rules for the receipt rule set that is currently active:
response = client.describe_active_receipt_rule_set(
)
print(response)
Expected Output:
{
'Metadata': {
'CreatedTimestamp': datetime(2016, 7, 15, 16, 25, 59, 4, 197, 0),
'Name': 'default-rule-set',
},
'Rules': [
{
'Actions': [
{
'S3Action': {
'BucketName': 'MyBucket',
'ObjectKeyPrefix': 'email',
},
},
],
'Enabled': True,
'Name': 'MyRule',
'ScanEnabled': True,
'TlsPolicy': 'Optional',
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_configuration_set(**kwargs)¶Returns the details of the specified configuration set.
Configuration sets enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.describe_configuration_set(
ConfigurationSetName='string',
ConfigurationSetAttributeNames=[
'eventDestinations',
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ConfigurationSet': {
'Name': 'string'
},
'EventDestinations': [
{
'Name': 'string',
'Enabled': True|False,
'MatchingEventTypes': [
'send'|'reject'|'bounce'|'complaint'|'delivery'|'open'|'click',
],
'KinesisFirehoseDestination': {
'IAMRoleARN': 'string',
'DeliveryStreamARN': 'string'
},
'CloudWatchDestination': {
'DimensionConfigurations': [
{
'DimensionName': 'string',
'DimensionValueSource': 'messageTag'|'emailHeader'|'linkTag',
'DefaultDimensionValue': 'string'
},
]
},
'SNSDestination': {
'TopicARN': 'string'
}
},
]
}
Response Structure
|
describe_receipt_rule(**kwargs)¶Returns the details of the specified receipt rule.
For information about setting up receipt rules, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.describe_receipt_rule(
RuleSetName='string',
RuleName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Rule': {
'Name': 'string',
'Enabled': True|False,
'TlsPolicy': 'Require'|'Optional',
'Recipients': [
'string',
],
'Actions': [
{
'S3Action': {
'TopicArn': 'string',
'BucketName': 'string',
'ObjectKeyPrefix': 'string',
'KmsKeyArn': 'string'
},
'BounceAction': {
'TopicArn': 'string',
'SmtpReplyCode': 'string',
'StatusCode': 'string',
'Message': 'string',
'Sender': 'string'
},
'WorkmailAction': {
'TopicArn': 'string',
'OrganizationArn': 'string'
},
'LambdaAction': {
'TopicArn': 'string',
'FunctionArn': 'string',
'InvocationType': 'Event'|'RequestResponse'
},
'StopAction': {
'Scope': 'RuleSet',
'TopicArn': 'string'
},
'AddHeaderAction': {
'HeaderName': 'string',
'HeaderValue': 'string'
},
'SNSAction': {
'TopicArn': 'string',
'Encoding': 'UTF-8'|'Base64'
}
},
],
'ScanEnabled': True|False
}
}
Response Structure
|
Examples
The following example returns the details of a receipt rule:
response = client.describe_receipt_rule(
RuleName='MyRule',
RuleSetName='MyRuleSet',
)
print(response)
Expected Output:
{
'Rule': {
'Actions': [
{
'S3Action': {
'BucketName': 'MyBucket',
'ObjectKeyPrefix': 'email',
},
},
],
'Enabled': True,
'Name': 'MyRule',
'ScanEnabled': True,
'TlsPolicy': 'Optional',
},
'ResponseMetadata': {
'...': '...',
},
}
describe_receipt_rule_set(**kwargs)¶Returns the details of the specified receipt rule set.
For information about managing receipt rule sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.describe_receipt_rule_set(
RuleSetName='string'
)
| Parameters: | RuleSetName (string) – [REQUIRED] The name of the receipt rule set to describe. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'Metadata': {
'Name': 'string',
'CreatedTimestamp': datetime(2015, 1, 1)
},
'Rules': [
{
'Name': 'string',
'Enabled': True|False,
'TlsPolicy': 'Require'|'Optional',
'Recipients': [
'string',
],
'Actions': [
{
'S3Action': {
'TopicArn': 'string',
'BucketName': 'string',
'ObjectKeyPrefix': 'string',
'KmsKeyArn': 'string'
},
'BounceAction': {
'TopicArn': 'string',
'SmtpReplyCode': 'string',
'StatusCode': 'string',
'Message': 'string',
'Sender': 'string'
},
'WorkmailAction': {
'TopicArn': 'string',
'OrganizationArn': 'string'
},
'LambdaAction': {
'TopicArn': 'string',
'FunctionArn': 'string',
'InvocationType': 'Event'|'RequestResponse'
},
'StopAction': {
'Scope': 'RuleSet',
'TopicArn': 'string'
},
'AddHeaderAction': {
'HeaderName': 'string',
'HeaderValue': 'string'
},
'SNSAction': {
'TopicArn': 'string',
'Encoding': 'UTF-8'|'Base64'
}
},
],
'ScanEnabled': True|False
},
]
}
Response Structure
|
Examples
The following example returns the metadata and receipt rules of a receipt rule set:
response = client.describe_receipt_rule_set(
RuleSetName='MyRuleSet',
)
print(response)
Expected Output:
{
'Metadata': {
'CreatedTimestamp': datetime(2016, 7, 15, 16, 25, 59, 4, 197, 0),
'Name': 'MyRuleSet',
},
'Rules': [
{
'Actions': [
{
'S3Action': {
'BucketName': 'MyBucket',
'ObjectKeyPrefix': 'email',
},
},
],
'Enabled': True,
'Name': 'MyRule',
'ScanEnabled': True,
'TlsPolicy': 'Optional',
},
],
'ResponseMetadata': {
'...': '...',
},
}
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
| Parameters: |
|
|---|---|
| Returns: | The presigned url |
get_identity_dkim_attributes(**kwargs)¶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:
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 .
See also: AWS API Documentation
Request Syntax
response = client.get_identity_dkim_attributes(
Identities=[
'string',
]
)
| Parameters: | Identities (list) – [REQUIRED] A list of one or more verified identities - email addresses, domains, or both.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'DkimAttributes': {
'string': {
'DkimEnabled': True|False,
'DkimVerificationStatus': 'Pending'|'Success'|'Failed'|'TemporaryFailure'|'NotStarted',
'DkimTokens': [
'string',
]
}
}
}
Response Structure
|
Examples
The following example retrieves the Amazon SES Easy DKIM attributes for a list of identities:
response = client.get_identity_dkim_attributes(
Identities=[
'example.com',
'user@example.com',
],
)
print(response)
Expected Output:
{
'DkimAttributes': {
'example.com': {
'DkimEnabled': True,
'DkimTokens': [
'EXAMPLEjcs5xoyqytjsotsijas7236gr',
'EXAMPLEjr76cvoc6mysspnioorxsn6ep',
'EXAMPLEkbmkqkhlm2lyz77ppkulerm4k',
],
'DkimVerificationStatus': 'Success',
},
'user@example.com': {
'DkimEnabled': False,
'DkimVerificationStatus': 'NotStarted',
},
},
'ResponseMetadata': {
'...': '...',
},
}
get_identity_mail_from_domain_attributes(**kwargs)¶Returns the custom MAIL FROM attributes for a list of identities (email addresses and/or domains).
This action is throttled at one request per second and can only get custom MAIL FROM attributes for up to 100 identities at a time.
See also: AWS API Documentation
Request Syntax
response = client.get_identity_mail_from_domain_attributes(
Identities=[
'string',
]
)
| Parameters: | Identities (list) – [REQUIRED] A list of one or more identities.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'MailFromDomainAttributes': {
'string': {
'MailFromDomain': 'string',
'MailFromDomainStatus': 'Pending'|'Success'|'Failed'|'TemporaryFailure',
'BehaviorOnMXFailure': 'UseDefaultValue'|'RejectMessage'
}
}
}
Response Structure
|
Examples
The following example returns the custom MAIL FROM attributes for an identity:
response = client.get_identity_mail_from_domain_attributes(
Identities=[
'example.com',
],
)
print(response)
Expected Output:
{
'MailFromDomainAttributes': {
'example.com': {
'BehaviorOnMXFailure': 'UseDefaultValue',
'MailFromDomain': 'bounces.example.com',
'MailFromDomainStatus': 'Success',
},
},
'ResponseMetadata': {
'...': '...',
},
}
get_identity_notification_attributes(**kwargs)¶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 .
See also: AWS API Documentation
Request Syntax
response = client.get_identity_notification_attributes(
Identities=[
'string',
]
)
| Parameters: | Identities (list) – [REQUIRED] A list of one or more identities. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples:
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'NotificationAttributes': {
'string': {
'BounceTopic': 'string',
'ComplaintTopic': 'string',
'DeliveryTopic': 'string',
'ForwardingEnabled': True|False,
'HeadersInBounceNotificationsEnabled': True|False,
'HeadersInComplaintNotificationsEnabled': True|False,
'HeadersInDeliveryNotificationsEnabled': True|False
}
}
}
Response Structure
|
Examples
The following example returns the notification attributes for an identity:
response = client.get_identity_notification_attributes(
Identities=[
'example.com',
],
)
print(response)
Expected Output:
{
'NotificationAttributes': {
'example.com': {
'BounceTopic': 'arn:aws:sns:us-east-1:EXAMPLE65304:ExampleTopic',
'ForwardingEnabled': True,
'HeadersInBounceNotificationsEnabled': False,
'HeadersInComplaintNotificationsEnabled': False,
'HeadersInDeliveryNotificationsEnabled': False,
},
},
'ResponseMetadata': {
'...': '...',
},
}
get_identity_policies(**kwargs)¶Returns the requested sending authorization policies for the given identity (an email address or a domain). The policies are returned as a map of policy names to policy contents. You can retrieve a maximum of 20 policies at a time.
Note
This API is for the identity owner only. If you have not verified the identity, this API will return an error.
Sending authorization is a feature that enables an identity owner to authorize other senders to use its identities. For information about using sending authorization, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.get_identity_policies(
Identity='string',
PolicyNames=[
'string',
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Policies': {
'string': 'string'
}
}
Response Structure
|
Examples
The following example returns a sending authorization policy for an identity:
response = client.get_identity_policies(
Identity='example.com',
PolicyNames=[
'MyPolicy',
],
)
print(response)
Expected Output:
{
'Policies': {
'MyPolicy': '{"Version":"2008-10-17","Statement":[{"Sid":"stmt1469123904194","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::123456789012:root"},"Action":["ses:SendEmail","ses:SendRawEmail"],"Resource":"arn:aws:ses:us-east-1:EXAMPLE65304:identity/example.com"}]}',
},
'ResponseMetadata': {
'...': '...',
},
}
get_identity_verification_attributes(**kwargs)¶Given a list of identities (email addresses and/or domains), returns the verification status and (for domain identities) the verification token for each identity.
The verification status of an email address is “Pending” until the email address owner clicks the link within the verification email that Amazon SES sent to that address. If the email address owner clicks the link within 24 hours, the verification status of the email address changes to “Success”. If the link is not clicked within 24 hours, the verification status changes to “Failed.” In that case, if you still want to verify the email address, you must restart the verification process from the beginning.
For domain identities, the domain’s verification status is “Pending” as Amazon SES searches for the required TXT record in the DNS settings of the domain. When Amazon SES detects the record, the domain’s verification status changes to “Success”. If Amazon SES is unable to detect the record within 72 hours, the domain’s verification status changes to “Failed.” In that case, if you still want to verify the domain, you must restart the verification process from the beginning.
This action is throttled at one request per second and can only get verification attributes for up to 100 identities at a time.
See also: AWS API Documentation
Request Syntax
response = client.get_identity_verification_attributes(
Identities=[
'string',
]
)
| Parameters: | Identities (list) – [REQUIRED] A list of identities.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'VerificationAttributes': {
'string': {
'VerificationStatus': 'Pending'|'Success'|'Failed'|'TemporaryFailure'|'NotStarted',
'VerificationToken': 'string'
}
}
}
Response Structure
|
Examples
The following example returns the verification status and the verification token for a domain identity:
response = client.get_identity_verification_attributes(
Identities=[
'example.com',
],
)
print(response)
Expected Output:
{
'VerificationAttributes': {
'example.com': {
'VerificationStatus': 'Success',
'VerificationToken': 'EXAMPLE3VYb9EDI2nTOQRi/Tf6MI/6bD6THIGiP1MVY=',
},
},
'ResponseMetadata': {
'...': '...',
},
}
get_paginator(operation_name)¶Create a paginator for an operation.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Raises: | OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
| Return type: | L{botocore.paginate.Paginator} |
| Returns: | A paginator object. |
get_send_quota()¶Returns the user’s current sending limits.
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.get_send_quota()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'Max24HourSend': 123.0,
'MaxSendRate': 123.0,
'SentLast24Hours': 123.0
}
Response Structure
|
Examples
The following example returns the Amazon SES sending limits for an AWS account:
response = client.get_send_quota(
)
print(response)
Expected Output:
{
'Max24HourSend': 200,
'MaxSendRate': 1,
'SentLast24Hours': 1,
'ResponseMetadata': {
'...': '...',
},
}
get_send_statistics()¶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.
See also: AWS API Documentation
Request Syntax
response = client.get_send_statistics()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'SendDataPoints': [
{
'Timestamp': datetime(2015, 1, 1),
'DeliveryAttempts': 123,
'Bounces': 123,
'Complaints': 123,
'Rejects': 123
},
]
}
Response Structure
|
Examples
The following example returns Amazon SES sending statistics:
response = client.get_send_statistics(
)
print(response)
Expected Output:
{
'SendDataPoints': [
{
'Bounces': 0,
'Complaints': 0,
'DeliveryAttempts': 5,
'Rejects': 0,
'Timestamp': datetime(2016, 7, 13, 22, 43, 0, 2, 195, 0),
},
{
'Bounces': 0,
'Complaints': 0,
'DeliveryAttempts': 3,
'Rejects': 0,
'Timestamp': datetime(2016, 7, 13, 23, 13, 0, 2, 195, 0),
},
{
'Bounces': 0,
'Complaints': 0,
'DeliveryAttempts': 1,
'Rejects': 0,
'Timestamp': datetime(2016, 7, 13, 21, 13, 0, 2, 195, 0),
},
],
'ResponseMetadata': {
'...': '...',
},
}
get_waiter(waiter_name)¶list_configuration_sets(**kwargs)¶Lists the configuration sets associated with your AWS account.
Configuration sets enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second and can return up to 50 configuration sets at a time.
See also: AWS API Documentation
Request Syntax
response = client.list_configuration_sets(
NextToken='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ConfigurationSets': [
{
'Name': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
list_identities(**kwargs)¶Returns a list containing all of the identities (email addresses and domains) for your AWS account, regardless of verification status.
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.list_identities(
IdentityType='EmailAddress'|'Domain',
NextToken='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Identities': [
'string',
],
'NextToken': 'string'
}
Response Structure
|
Examples
The following example lists the email address identities that have been submitted for verification with Amazon SES:
response = client.list_identities(
IdentityType='EmailAddress',
MaxItems=123,
NextToken='',
)
print(response)
Expected Output:
{
'Identities': [
'user@example.com',
],
'NextToken': '',
'ResponseMetadata': {
'...': '...',
},
}
list_identity_policies(**kwargs)¶Returns a list of sending authorization policies that are attached to the given identity (an email address or a domain). This API returns only a list. If you want the actual policy content, you can use GetIdentityPolicies .
Note
This API is for the identity owner only. If you have not verified the identity, this API will return an error.
Sending authorization is a feature that enables an identity owner to authorize other senders to use its identities. For information about using sending authorization, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.list_identity_policies(
Identity='string'
)
| Parameters: | Identity (string) – [REQUIRED] The identity that is associated with the policy for which the policies will be listed. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: To successfully call this API, you must own the identity. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'PolicyNames': [
'string',
]
}
Response Structure
|
Examples
The following example returns a list of sending authorization policies that are attached to an identity:
response = client.list_identity_policies(
Identity='example.com',
)
print(response)
Expected Output:
{
'PolicyNames': [
'MyPolicy',
],
'ResponseMetadata': {
'...': '...',
},
}
list_receipt_filters()¶Lists the IP address filters associated with your AWS account.
For information about managing IP address filters, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.list_receipt_filters()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'Filters': [
{
'Name': 'string',
'IpFilter': {
'Policy': 'Block'|'Allow',
'Cidr': 'string'
}
},
]
}
Response Structure
|
Examples
The following example lists the IP address filters that are associated with an AWS account:
response = client.list_receipt_filters(
)
print(response)
Expected Output:
{
'Filters': [
{
'IpFilter': {
'Cidr': '1.2.3.4/24',
'Policy': 'Block',
},
'Name': 'MyFilter',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_receipt_rule_sets(**kwargs)¶Lists the receipt rule sets that exist under your AWS account. If there are additional receipt rule sets to be retrieved, you will receive a NextToken that you can provide to the next call to ListReceiptRuleSets to retrieve the additional entries.
For information about managing receipt rule sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.list_receipt_rule_sets(
NextToken='string'
)
| Parameters: | NextToken (string) – A token returned from a previous call to ListReceiptRuleSets to indicate the position in the receipt rule set list. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'RuleSets': [
{
'Name': 'string',
'CreatedTimestamp': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
|
Examples
The following example lists the receipt rule sets that exist under an AWS account:
response = client.list_receipt_rule_sets(
NextToken='',
)
print(response)
Expected Output:
{
'NextToken': '',
'RuleSets': [
{
'CreatedTimestamp': datetime(2016, 7, 15, 16, 25, 59, 4, 197, 0),
'Name': 'MyRuleSet',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_verified_email_addresses()¶Returns a list containing all of the email addresses that have been verified.
Warning
The ListVerifiedEmailAddresses action is deprecated as of the May 15, 2012 release of Domain Verification. The ListIdentities action is now preferred.
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.list_verified_email_addresses()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'VerifiedEmailAddresses': [
'string',
]
}
Response Structure
|
Examples
The following example lists all email addresses that have been submitted for verification with Amazon SES:
response = client.list_verified_email_addresses(
)
print(response)
Expected Output:
{
'VerifiedEmailAddresses': [
'user1@example.com',
'user2@example.com',
],
'ResponseMetadata': {
'...': '...',
},
}
put_identity_policy(**kwargs)¶Adds or updates a sending authorization policy for the specified identity (an email address or a domain).
Note
This API is for the identity owner only. If you have not verified the identity, this API will return an error.
Sending authorization is a feature that enables an identity owner to authorize other senders to use its identities. For information about using sending authorization, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.put_identity_policy(
Identity='string',
PolicyName='string',
Policy='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example adds a sending authorization policy to an identity:
response = client.put_identity_policy(
Identity='example.com',
Policy='{"Version":"2008-10-17","Statement":[{"Sid":"stmt1469123904194","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::123456789012:root"},"Action":["ses:SendEmail","ses:SendRawEmail"],"Resource":"arn:aws:ses:us-east-1:EXAMPLE65304:identity/example.com"}]}',
PolicyName='MyPolicy',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
reorder_receipt_rule_set(**kwargs)¶Reorders the receipt rules within a receipt rule set.
Note
All of the rules in the rule set must be represented in this request. That is, this API will return an error if the reorder request doesn’t explicitly position all of the rules.
For information about managing receipt rule sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.reorder_receipt_rule_set(
RuleSetName='string',
RuleNames=[
'string',
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example reorders the receipt rules within a receipt rule set:
response = client.reorder_receipt_rule_set(
RuleNames=[
'MyRule',
'MyOtherRule',
],
RuleSetName='MyRuleSet',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
send_bounce(**kwargs)¶Generates and sends a bounce message to the sender of an email you received through Amazon SES. You can only use this API on an email up to 24 hours after you receive it.
Note
You cannot use this API 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 .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.send_bounce(
OriginalMessageId='string',
BounceSender='string',
Explanation='string',
MessageDsn={
'ReportingMta': 'string',
'ArrivalDate': datetime(2015, 1, 1),
'ExtensionFields': [
{
'Name': 'string',
'Value': 'string'
},
]
},
BouncedRecipientInfoList=[
{
'Recipient': 'string',
'RecipientArn': 'string',
'BounceType': 'DoesNotExist'|'MessageTooLarge'|'ExceededQuota'|'ContentRejected'|'Undefined'|'TemporaryFailure',
'RecipientDsnFields': {
'FinalRecipient': 'string',
'Action': 'failed'|'delayed'|'delivered'|'relayed'|'expanded',
'RemoteMta': 'string',
'Status': 'string',
'DiagnosticCode': 'string',
'LastAttemptDate': datetime(2015, 1, 1),
'ExtensionFields': [
{
'Name': 'string',
'Value': 'string'
},
]
}
},
],
BounceSenderArn='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'MessageId': 'string'
}
Response Structure
|
send_email(**kwargs)¶Composes an email message based on input data, and then immediately queues the message for sending.
There are several important points to know about SendEmail :
See also: AWS API Documentation
Request Syntax
response = 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',
SourceArn='string',
ReturnPathArn='string',
Tags=[
{
'Name': 'string',
'Value': 'string'
},
],
ConfigurationSetName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'MessageId': 'string'
}
Response Structure
|
Examples
The following example sends a formatted email:
response = client.send_email(
Destination={
'BccAddresses': [
],
'CcAddresses': [
'recipient3@example.com',
],
'ToAddresses': [
'recipient1@example.com',
'recipient2@example.com',
],
},
Message={
'Body': {
'Html': {
'Charset': 'UTF-8',
'Data': 'This message body contains HTML formatting. It can, for example, contain links like this one: <a class="ulink" href="http://docs.aws.amazon.com/ses/latest/DeveloperGuide" target="_blank">Amazon SES Developer Guide</a>.',
},
'Text': {
'Charset': 'UTF-8',
'Data': 'This is the message body in text format.',
},
},
'Subject': {
'Charset': 'UTF-8',
'Data': 'Test email',
},
},
ReplyToAddresses=[
],
ReturnPath='',
ReturnPathArn='',
Source='sender@example.com',
SourceArn='',
)
print(response)
Expected Output:
{
'MessageId': 'EXAMPLE78603177f-7a5433e7-8edb-42ae-af10-f0181f34d6ee-000000',
'ResponseMetadata': {
'...': '...',
},
}
send_raw_email(**kwargs)¶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.
There are several important points to know about SendRawEmail :
SendRawEmail enables you to specify the cross-account identity for the email’s “Source,” “From,” and “Return-Path” parameters in one of two ways: you can pass optional parameters SourceArn , FromArn , and/or ReturnPathArn to the API, or you can include the following X-headers in the header of your raw email:X-SES-SOURCE-ARNX-SES-FROM-ARNX-SES-RETURN-PATH-ARNWarning
Do not include these X-headers in the DKIM signature, because they are removed by Amazon SES before sending the email.
For the most common sending authorization use case, we recommend that you specify the SourceIdentityArn and do not specify either the FromIdentityArn or ReturnPathIdentityArn . (The same note applies to the corresponding X-headers.) If you only specify the SourceIdentityArn , Amazon SES will simply set the “From” address and the “Return Path” address to the identity specified in SourceIdentityArn . For more information about sending authorization, see the Amazon SES Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.send_raw_email(
Source='string',
Destinations=[
'string',
],
RawMessage={
'Data': b'bytes'
},
FromArn='string',
SourceArn='string',
ReturnPathArn='string',
Tags=[
{
'Name': 'string',
'Value': 'string'
},
],
ConfigurationSetName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'MessageId': 'string'
}
Response Structure
|
Examples
The following example sends an email with an attachment:
response = client.send_raw_email(
Destinations=[
],
FromArn='',
RawMessage={
'Data': 'From: sender@example.com\nTo: recipient@example.com\nSubject: Test email (contains an attachment)\nMIME-Version: 1.0\nContent-type: Multipart/Mixed; boundary="NextPart"\n\n--NextPart\nContent-Type: text/plain\n\nThis is the message body.\n\n--NextPart\nContent-Type: text/plain;\nContent-Disposition: attachment; filename="attachment.txt"\n\nThis is the text in the attachment.\n\n--NextPart--',
},
ReturnPathArn='',
Source='',
SourceArn='',
)
print(response)
Expected Output:
{
'MessageId': 'EXAMPLEf3f73d99b-c63fb06f-d263-41f8-a0fb-d0dc67d56c07-000000',
'ResponseMetadata': {
'...': '...',
},
}
set_active_receipt_rule_set(**kwargs)¶Sets the specified receipt rule set as the active receipt rule set.
Note
To disable your email-receiving through Amazon SES completely, you can call this API with RuleSetName set to null.
For information about managing receipt rule sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.set_active_receipt_rule_set(
RuleSetName='string'
)
| Parameters: | RuleSetName (string) – The name of the receipt rule set to make active. Setting this value to null disables all email receiving. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
Examples
The following example sets the active receipt rule set:
response = client.set_active_receipt_rule_set(
RuleSetName='RuleSetToActivate',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
set_identity_dkim_enabled(**kwargs)¶Enables or disables Easy DKIM signing of email sent from an identity:
example.com ), then Amazon SES will DKIM-sign all email sent by addresses under that domain name (e.g., user@example.com ).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 .
See also: AWS API Documentation
Request Syntax
response = client.set_identity_dkim_enabled(
Identity='string',
DkimEnabled=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example configures Amazon SES to Easy DKIM-sign the email sent from an identity:
response = client.set_identity_dkim_enabled(
DkimEnabled=True,
Identity='user@example.com',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
set_identity_feedback_forwarding_enabled(**kwargs)¶Given an identity (an email address or a 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.
Note
Feedback forwarding does not apply to delivery notifications. Delivery notifications are only available through Amazon SNS.
This action is throttled at one request per second.
For more information about using notifications with Amazon SES, see the Amazon SES Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.set_identity_feedback_forwarding_enabled(
Identity='string',
ForwardingEnabled=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example configures Amazon SES to forward an identity’s bounces and complaints via email:
response = client.set_identity_feedback_forwarding_enabled(
ForwardingEnabled=True,
Identity='user@example.com',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
set_identity_headers_in_notifications_enabled(**kwargs)¶Given an identity (an email address or a domain), sets whether Amazon SES includes the original email headers in the Amazon Simple Notification Service (Amazon SNS) notifications of a specified type.
This action is throttled at one request per second.
For more information about using notifications with Amazon SES, see the Amazon SES Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.set_identity_headers_in_notifications_enabled(
Identity='string',
NotificationType='Bounce'|'Complaint'|'Delivery',
Enabled=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example configures Amazon SES to include the original email headers in the Amazon SNS bounce notifications for an identity:
response = client.set_identity_headers_in_notifications_enabled(
Enabled=True,
Identity='user@example.com',
NotificationType='Bounce',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
set_identity_mail_from_domain(**kwargs)¶Enables or disables the custom MAIL FROM domain setup for a verified identity (an email address or a domain).
Warning
To send emails using the specified MAIL FROM domain, you must add an MX record to your MAIL FROM domain’s DNS settings. If you want your emails to pass Sender Policy Framework (SPF) checks, you must also add or update an SPF record. For more information, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.set_identity_mail_from_domain(
Identity='string',
MailFromDomain='string',
BehaviorOnMXFailure='UseDefaultValue'|'RejectMessage'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example configures Amazon SES to use a custom MAIL FROM domain for an identity:
response = client.set_identity_mail_from_domain(
BehaviorOnMXFailure='UseDefaultValue',
Identity='user@example.com',
MailFromDomain='bounces.example.com',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
set_identity_notification_topic(**kwargs)¶Given an identity (an email address or a 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 .
Note
Unless feedback forwarding is enabled, you must specify Amazon SNS topics for bounce and complaint notifications. For more information, see SetIdentityFeedbackForwardingEnabled .
This action is throttled at one request per second.
For more information about feedback notification, see the Amazon SES Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.set_identity_notification_topic(
Identity='string',
NotificationType='Bounce'|'Complaint'|'Delivery',
SnsTopic='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example sets the Amazon SNS topic to which Amazon SES will publish bounce, complaint, and/or delivery notifications for emails sent with the specified identity as the Source:
response = client.set_identity_notification_topic(
Identity='user@example.com',
NotificationType='Bounce',
SnsTopic='arn:aws:sns:us-west-2:111122223333:MyTopic',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
set_receipt_rule_position(**kwargs)¶Sets the position of the specified receipt rule in the receipt rule set.
For information about managing receipt rules, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.set_receipt_rule_position(
RuleSetName='string',
RuleName='string',
After='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example sets the position of a receipt rule in a receipt rule set:
response = client.set_receipt_rule_position(
After='PutRuleAfterThisRule',
RuleName='RuleToReposition',
RuleSetName='MyRuleSet',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
update_configuration_set_event_destination(**kwargs)¶Updates the event destination of a configuration set.
Note
When you create or update an event destination, you must provide one, and only one, destination. The destination can be Amazon CloudWatch, Amazon Kinesis Firehose, or Amazon Simple Notification Service (Amazon SNS).
Event destinations are associated with configuration sets, which enable you to publish email sending events to Amazon CloudWatch, Amazon Kinesis Firehose, or Amazon Simple Notification Service (Amazon SNS). For information about using configuration sets, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.update_configuration_set_event_destination(
ConfigurationSetName='string',
EventDestination={
'Name': 'string',
'Enabled': True|False,
'MatchingEventTypes': [
'send'|'reject'|'bounce'|'complaint'|'delivery'|'open'|'click',
],
'KinesisFirehoseDestination': {
'IAMRoleARN': 'string',
'DeliveryStreamARN': 'string'
},
'CloudWatchDestination': {
'DimensionConfigurations': [
{
'DimensionName': 'string',
'DimensionValueSource': 'messageTag'|'emailHeader'|'linkTag',
'DefaultDimensionValue': 'string'
},
]
},
'SNSDestination': {
'TopicARN': 'string'
}
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
update_receipt_rule(**kwargs)¶Updates a receipt rule.
For information about managing receipt rules, see the Amazon SES Developer Guide .
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.update_receipt_rule(
RuleSetName='string',
Rule={
'Name': 'string',
'Enabled': True|False,
'TlsPolicy': 'Require'|'Optional',
'Recipients': [
'string',
],
'Actions': [
{
'S3Action': {
'TopicArn': 'string',
'BucketName': 'string',
'ObjectKeyPrefix': 'string',
'KmsKeyArn': 'string'
},
'BounceAction': {
'TopicArn': 'string',
'SmtpReplyCode': 'string',
'StatusCode': 'string',
'Message': 'string',
'Sender': 'string'
},
'WorkmailAction': {
'TopicArn': 'string',
'OrganizationArn': 'string'
},
'LambdaAction': {
'TopicArn': 'string',
'FunctionArn': 'string',
'InvocationType': 'Event'|'RequestResponse'
},
'StopAction': {
'Scope': 'RuleSet',
'TopicArn': 'string'
},
'AddHeaderAction': {
'HeaderName': 'string',
'HeaderValue': 'string'
},
'SNSAction': {
'TopicArn': 'string',
'Encoding': 'UTF-8'|'Base64'
}
},
],
'ScanEnabled': True|False
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
The following example updates a receipt rule to use an Amazon S3 action:
response = client.update_receipt_rule(
Rule={
'Actions': [
{
'S3Action': {
'BucketName': 'MyBucket',
'ObjectKeyPrefix': 'email',
},
},
],
'Enabled': True,
'Name': 'MyRule',
'ScanEnabled': True,
'TlsPolicy': 'Optional',
},
RuleSetName='MyRuleSet',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
verify_domain_dkim(**kwargs)¶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 .
See also: AWS API Documentation
Request Syntax
response = client.verify_domain_dkim(
Domain='string'
)
| Parameters: | Domain (string) – [REQUIRED] The name of the domain to be verified for Easy DKIM signing. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'DkimTokens': [
'string',
]
}
Response Structure
|
Examples
The following example generates DKIM tokens for a domain that has been verified with Amazon SES:
response = client.verify_domain_dkim(
Domain='example.com',
)
print(response)
Expected Output:
{
'DkimTokens': [
'EXAMPLEq76owjnks3lnluwg65scbemvw',
'EXAMPLEi3dnsj67hstzaj673klariwx2',
'EXAMPLEwfbtcukvimehexktmdtaz6naj',
],
'ResponseMetadata': {
'...': '...',
},
}
verify_domain_identity(**kwargs)¶Verifies a domain.
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.verify_domain_identity(
Domain='string'
)
| Parameters: | Domain (string) – [REQUIRED] The domain to be verified. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'VerificationToken': 'string'
}
Response Structure
|
Examples
The following example starts the domain verification process with Amazon SES:
response = client.verify_domain_identity(
Domain='example.com',
)
print(response)
Expected Output:
{
'VerificationToken': 'eoEmxw+YaYhb3h3iVJHuXMJXqeu1q1/wwmvjuEXAMPLE',
'ResponseMetadata': {
'...': '...',
},
}
verify_email_address(**kwargs)¶Verifies an email address. This action causes a confirmation email message to be sent to the specified address.
Warning
The VerifyEmailAddress action is deprecated as of the May 15, 2012 release of Domain Verification. The VerifyEmailIdentity action is now preferred.
This action is throttled at one request per second.
See also: AWS API Documentation
Request Syntax
response = client.verify_email_address(
EmailAddress='string'
)
| Parameters: | EmailAddress (string) – [REQUIRED] The email address to be verified. |
|---|---|
| Returns: | None |
Examples
The following example starts the email address verification process with Amazon SES:
response = client.verify_email_address(
EmailAddress='user@example.com',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
verify_email_identity(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.verify_email_identity(
EmailAddress='string'
)
| Parameters: | EmailAddress (string) – [REQUIRED] The email address to be verified. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
Examples
The following example starts the email address verification process with Amazon SES:
response = client.verify_email_identity(
EmailAddress='user@example.com',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
The available paginators are:
SES.Paginator.ListIdentities¶paginator = client.get_paginator('list_identities')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from SES.Client.list_identities().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
IdentityType='EmailAddress'|'Domain',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Identities': [
'string',
],
}
Response Structure
|
The available waiters are:
SES.Waiter.IdentityExists¶waiter = client.get_waiter('identity_exists')
wait(**kwargs)¶Polls SES.Client.get_identity_verification_attributes() every 3 seconds until a successful state is reached. An error is returned after 20 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Identities=[
'string',
]
)
| Parameters: | Identities (list) – [REQUIRED] A list of identities.
|
|---|---|
| Returns: | None |