Easily change the dates and times on your photos and videos
Click here for more info about the app
English dictionary with notifications so you won't forget what you're studying!
Click here for more info about the app
The app that quizzes and scores you on your vocabulary!
Click here for more info about the app

How to send email with Python, smtplib and Postmark


Here is a quick code snippet showing how to send email via SMTP with Postmark without any dependencies. It assumes you are using Heroku and have added the addon. But if not just make sure your api keys are set as environment vars.

from os import environ as env
from email.mime.text import MIMEText
import smtplib

msg = MIMEText("Message body")
msg['To'] = ""
msg['Bcc'] = ""
msg['From'] =""
msg['Subject'] = "Subject line"
server = smtplib.SMTP('', 587)
server.login(env.get('POSTMARK_API_KEY', '...'), env.get('POSTMARK_API_KEY', '...'))
server.sendmail(msg['From'], ["", ""], msg.as_string())
Tagged w/ #python #email #sendmail #postmark #smtp