手机
当前位置:查字典教程网 >脚本专栏 >python >python登录pop3邮件服务器接收邮件的方法
python登录pop3邮件服务器接收邮件的方法
摘要:本文实例讲述了python登录pop3邮件服务器接收邮件的方法。分享给大家供大家参考。具体实现方法如下:importpoplib,strin...

本文实例讲述了python登录pop3邮件服务器接收邮件的方法。分享给大家供大家参考。具体实现方法如下:

import poplib, string PopServerName = "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程序设计有所帮助。

【python登录pop3邮件服务器接收邮件的方法】相关文章:

Python生成pdf文件的方法

python处理文本文件实现生成指定格式文件的方法

Python转码问题的解决方法

Python的函数嵌套的使用方法

python实现网页链接提取的方法分享

Python实现扫描指定目录下的子目录及文件的方法

python实现dnspod自动更新dns解析的方法

Python列表推导式的使用方法

python实现linux服务器批量修改密码并生成execl

python3访问sina首页中文的处理方法

精品推荐
分类导航