本文實例講述了python通過郵件服務器端口發送郵件的方法。分享給大家供大家參考。具體實現方法如下:
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)
希望本文所述對大家的Python程序設計有所幫助。
新聞熱點
疑難解答