Setting up SES
For sending emails you will need a domain. If you don’t have one yet, buy one directly in AWS or just “transfer” the bought domain to Route53 (The DNS managment service by AWS) using nameservers. For example if you got your domain from GoDaddy, follow this video, the process is the same with other providers. Once our domain is added to Route53, we can use it to create and validate an identity in SES itself. This can either be single email adress (a@test.com) or the domain itself (test.com) which covers all the possible adresses.
Choose an approach and follow the first 90 seconds of this video.
Sending Emails with Python
SES offers two ways of sending emails:- through the SMTP interface (Simple Mail Transfer Protocol, just imagine this as the raw request approach)
- using the Python SDK
mail.py, you will see that we can send both text and HTML emails. You will have to create HTML files
and pass them to the function.
mail.py
.env, it has to match the identity you created.