• Notice regarding image hosts and attachments. See here.

Sending rich HTML emails with Python

Associate
Joined
30 Mar 2004
Posts
1,148
Location
West Wing
Whats the best way of sending HTML emails from Python 2.7? I have a script that uses smptlib library to send plain text emails from a gmail account. But I want to send the content as HTML with images.

Is there a third party API service or another Python library anyone can recommend?
 
I wouldn't bother yourself with the pain of setting up SMTP yourself, there's lots of things you'll miss which managed email services handle for you. Check out https://sendgrid.com/, they have a pretty generous free package and a nice python client library: https://github.com/sendgrid/sendgrid-python. They also have their own templating system if you don't want to deal with that on the python side.
 
Back
Top Bottom