Skip to content

Instantly share code, notes, and snippets.

@jthop
Created November 10, 2018 13:24
Show Gist options
  • Save jthop/fd3b418f7910d469384a774c76b34f39 to your computer and use it in GitHub Desktop.
Save jthop/fd3b418f7910d469384a774c76b34f39 to your computer and use it in GitHub Desktop.
#Send email via ses using boto3
import boto3
REGION = 'us-east-1'
TO = ['test@test.com']
TEXT_BODY = 'testing 1 2 3'
HTML_BODY = 'html body'
SUBJECT = 'boto'
client = boto3.client('ses', region_name=REGION)
response = client.send_email(
Destination={'ToAddresses': TO},
Message={
'Body': {
'Text': {'Data': TEXT_BODY},
'Html': {'Data': HTML_BODY}
},
'Subject': {'Data': SUBJECT},
},
Source='Mode14 <no-reply@mode14.com>',
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment