本文實(shí)例講述了python登錄pop3郵件服務(wù)器接收郵件的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
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
希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。
新聞熱點(diǎn)
疑難解答
圖片精選