fromAddress = 'sender@example.com' toAddress = 'me@my.domain' msg = "Subject: Hello This is the body of the message." import smtplib server = smtplib.SMTP("localhost", 25) server.sendmail(fromAddress, toAddress, msg)
希望本文所述对大家的Python程序设计有所帮助。