Sending emails using Python and AWS’ SES service is really easy. They provide an SMTP server that you can authenticate against and send email programmatically from your python scripts.
There is a wonderfully simple Python package called
emails I like to use for this purpose.
Otherwise, continue reading!
Getting AWS SES SMTP Setup
In order to start sending emails using AWS SES, and the SMTP server in particular, you will need to:
- Login to your AWS SES account, or Create an account
- Verify the sending domain
- Verify the email address you want to send through
- Create SMTP credentials to use with the above script
Using the Emails Module
pip install emails will make available a simple module that allows you to connect to an SMTP server for email sending.
Now you can write a python script as follows:
Learn more about Sending Emails using Python
The emails module used above can be found on the Python Package Index at: https://pypi.org/project/emails/
This code is backed by the following open-source contributions on Github at: https://github.com/lavr/python-emails