import smtplib import string, sys import os HOST = "mymailhost" FROM = "Admin Name <admin-email-address" TO = "myemailaddress" SUBJECT = "Changelist #4735 fixed the build!" BODY = "Let's celebrate a good build" body = string.join(( "From: %s" % FROM, "To: %s" % TO, "Subject: %s" % SUBJECT, "", BODY), "\r\n") print body server = smtplib.SMTP(HOST) server.sendmail(FROM, [TO], body) server.quit()