本文實(shí)例講述了python同時(shí)給兩個(gè)收件人發(fā)送郵件的方法。分享給大家供大家參考。具體分析如下:
該范例通過python內(nèi)置的smtplib包發(fā)送郵件
import smtplibimport stringhost = "localhost"fromclause = "a@b.com"toclause = "c@d.com, e@f.com"toclause = string.splitfields(toclause, ",")msgbody = """Test!Best Regards"""SMTPServer = smtplib.SMTP(host)SMTPServer.sendmail(fromclause, toclause, msgbody)SMTPServer.quit()
希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。
新聞熱點(diǎn)
疑難解答
圖片精選