#!/usr/bin/python
import smtplib
import string

HOST="smtp.gmail.com" //发件SMTP主机
tolist=['[email protected]','[email protected]','[email protected]'] //收件人列表
FROM="[email protected]" //发件人邮箱
SUBJECT="Python Module stmplib test email" //邮件主题
bodys=""" //内容
This is a test mail please delete this mail thank you """
BODY = string.join((
        "From: %s" % FROM,
        "To: %s" % ';'.join(tolist),
        "Subject: %s" % SUBJECT,
        "",
        bodys
        ),"\r\n")

server=smtplib.SMTP()
server.connect(HOST,"25")
server.starttls()
server.login("[email protected]","emailpassword") //发件人账户和密码
server.sendmail(FROM,tolist,BODY) //发送邮件
server.quit()