Poplib 无法正常工作?
我想从我的 gmail 收件箱中获取所有邮件,但我面临两个问题。
- 它不会获取所有电子邮件(根据 stat 函数中的计数)
- 它获取的电子邮件的顺序是随机的。
我不确定是否是 poplib 或 gmail pop 服务器的问题。
我在这里缺少什么?
I want to get all the messages from my gmail inbox, but I am facing 2 problems.
- It does not get all the emails, (as per the count in stat function)
- The order of emails it get is random.
I am unsure if its the problem with poplib or gmail pop server.
What am I missing here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你的代码是什么样的? 使用 poplib,您可以决定下载消息的顺序和数量。 poplib 文档 中的代码应该可以工作:
What does your code look like? Using poplib, you're able to decide on the order and number of the messages downloaded. The code from the poplib documentation should work:
您还可以尝试 imaplib 模块,因为 GMail 还提供通过 IMAP 协议访问电子邮件的功能。
You can also try
imaplib
module since GMail also provides access to email via IMAP protocol.为什么不尝试使用libgmail?
Why don't you try to use libgmail?
这是 Gmail 的问题:https://mail.google.com/support /bin/answer.py?answer=13291
尝试使用最近的:[电子邮件;protected] 作为您的电子邮件地址。 至少您上个月的所有邮件都会按正确的顺序排列。
It's the problem of gmail: https://mail.google.com/support/bin/answer.py?answer=13291
Try to use recent:[email protected] as your email address. At least you'll have all your last month mail in correct order.