本文實例講述了python登錄pop3郵件服務器接收郵件的方法。分享給大家供大家參考。具體實現方法如下:
import poplib, stringPopServerName = "mail.yourserver.com"PopServer = poplib.POP3(PopServerName)print PopServer.getwelcome()PopServer.user('yourName')PopServer.pass_('yourPass')r, items, octets = PopServer.list()msgid, size = string.split(items[-1])r, msg, octets = PopServer.retr(msgid)msg = string.join(msg, "/n")print msg希望本文所述對大家的Python程序設計有所幫助。
新聞熱點
疑難解答
圖片精選