Fri 14 May 2010
How to Send Email with Python
Posted by Mike under Cross-Platform, Python, System Administration
[10] Comments
Where I work, we run a number of login scripts written in Python. When an error occurs in one of those scripts, we want to know. So we wrote a simple Python script to email the error to us. Since then, I’ve needed to figure out a way to send attachments with some of my more advanced scripts. If you’re a long-time reader of this blog, then you may remember wxPyMail, which was a simple wxPython program that could send email. In this article, you’ll discover how to send email with just Python’s standard library. We will focus on smtplib and the email modules. (more…)