--Email platform provided by Amazon --Pay-as-you-go system
--Region selection --Register an email address for sending --Releasing transmission restrictions --Implementation of email sending process
Amazon SES currently supports the following regions:
Amazon SES requires you to verify and register your sending email address. (You cannot use an unverified email address.)
--Enter the email address you want to register for sending from the [Verify a New Adress] button on the [Email Addresses] tab of SES.
--You will receive an authentication email, so complete the authentication from the URL of the email.
If you do nothing, you can send emails only to the authenticated email address and the number of emails sent is limited, so you need to remove the restriction.
--Click the Request a Sending Limit Increase button on the SES Sending Statistics tab --You will be taken to the Support Center page, so enter the required information. --Application
import boto3
def main():
try:
client = boto3.client(
'ses',
aws_access_key_id={AWS_ACCESS_KEY_ID},
aws_secret_access_key={AWS_SECRET_ACCESS_KEY},
region_name='us-east-1' #Region where the sending email address is registered
)
client.send_email(
Destination={
'ToAddresses': ['[email protected]', '[email protected]'],
'BccAddresses': ['[email protected]']
},
Message={
'Body': {
'Text': {
'Data': 'the content of the email',
'Charset': 'utf-8'
}
},
'Subject': {
'Data': 'subject',
'Charset': 'utf-8'
}
},
Source='[email protected]', #Registered e-mail address
ConfigurationSetName='The name you want to display as the email sender'
)
except ClientError as e:
print(e.response['Error']['Message'])
else:
print(response['MessageId'])
Recommended Posts