HOST=mail_addr SUBJECT=mail_addr TO=mail_addr FROM=text=(random.randint()) BODY=string.join(( %FROM%TO%SUBJECTtext)) server=smtplib.SMTP_SSL(HOST) server.login() server.sendmail(FROM[TO]BODY) server.quit()
原文:http://linuxnewstar.blog.51cto.com/6967359/1852050