How to send HTML mails using Amazon SES (Simple Email Service) in python

As the title suggests, I was looking for a way to send HTML mails in python using Amazon SES but did not find anything (or maybe my search skills are bad).
So, once I found the solution, I thought I might share it with everyone.

The basic idea is that contents of the mail (raw-message) must be a JSON dictionary with “Data” as main key whose value is a key value pair containing entries with keys like “From”, “To” etc.
Sample code can be seen below.

2 Replies to “How to send HTML mails using Amazon SES (Simple Email Service) in python”

  1. is there any way not to define the region? I want to use the method but not for a particular region, can you help me with that?

  2. Afaik, the region parameter is mandatory, you can try executing the code by omitting it but I don’t think it will succeed.

Leave a Reply

Your email address will not be published. Required fields are marked *