1 Star 0 Fork 46

alex/qytang_Python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
2016.1.22 POP邮件阅读脚本 738 Bytes
一键复制 编辑 原始数据 按行查看 历史
现任明教教主-乾颐堂 提交于 2016-01-22 10:10 . new file
import poplib, getpass, sys, mailconfig
mailserver = mailconfig.popservername
mailuser = mailconfig.popusername
mailpasswd = getpass.getpass('Password for %s?' % mailserver)
print('Connecting...')
server = poplib.POP3(mailserver)
server.user(mailuser)
server.pass_(mailpasswd)
try:
print(server.getwelcome())
msgCount, msgBytes = server.stat()
print('There are', msgCount, 'mail message in', msgBytes, 'bytes')
print(server.list())
print('-' * 80)
input('[Press Enter key]')
for i in range(msgCount):
hdr, message, octets = server.retr(i + 1)
for line in message: print(line.decode())
print('-' * 80)
if i < msgCount - 1:
input('[Press Enter key]')
finally:
server.quit()
print('Bye.')
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/alexzhang666/qytang_Python.git
git@gitee.com:alexzhang666/qytang_Python.git
alexzhang666
qytang_Python
qytang_Python
master

搜索帮助