怎么样获取最新的10封邮件?
最近在做一个邮件应用。用户初始配置邮件的时候,只收取最近的10封邮件。
目前使用的一部分邮箱没有什么问题,现在由于用户量增加,其他的邮箱现在发现好多次这种情况,就是用户今天配置的邮箱,然而收到的最近10封邮件却是10天前的,最近几天有邮件却没有取下来。
经过观察发现,通过LIST命令取到的邮件列表并不是完全按照时间顺序来的,正常的邮件都是按照时间顺序来的,不正常的邮件这个列表是没有按照时间顺序的。
如果要严格按照收取最近的10封邮件,是不是需要获取历史邮件的header信息,解析出时间,然后一封一封去对比么?
希望了解的同学来解答我的疑问。谢谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你用的什么邮箱,一般邮箱都是可以设置POP 天数
In Gmail you can find these option in the Forwarding and POP/IMAP section;
Click on the gear icon in the top right corner next to your name and choose; Mail settings
Click on; Forwarding and POP/IMAP
Enable the option: Enable POP for all mail (even mail that’s already been downloaded)
Outlook’s send/receive history and setting the All Mail option
When you set this option in Gmail, Outlook’s own send/receive history will no longer apply and you will really download all mail again. So if you only found out that it did not download all your mail AFTER you’ve configured Outlook, setting this option in Gmail will mean that you’ll get duplicates in Outlook. To prevent them from mixing with what you already have downloaded, you can use one of the following strategies;
Delete all the mail that you’ve already downloaded or move them to another folder.
Create a (temporary) rule which moves all incoming email to a folder different than the Inbox folder.
Of course Outlook will keep a history again after the messages have been downloaded and won’t redownload all message again until you enable the option in Gmail again.