fromAddress = 'sender@example.com'toAddress = 'me@my.domain'msg = "Subject: Hello\n\nThis is the body of the message."import smtplibserver = smtplib.SMTP("localhost", 25)server.sendmail(fromAddress, toAddress, msg)