How to retrieve only new emails using POP3 protocol

≡放荡痞女 提交于 2019-11-28 01:05:33

问题


I am using POP3 protocol to retrieve my emails in my .NET application. I need to read just new emails only but found in many blogs that it is not possible to retrieve just "unseen" or "new" mails using POP3. Is that true? If so, could you please help me understand how Outlook Express manages to get new mails using POP3?

Is there any way that I can flag the seen mails in the email server itself? Or please help me find out a way to retrieve new mails using POP3 protocol.


回答1:


You have to store the UIDL of each email in a local database. When you want to check for new mail, you retrieve the UIDLs on the server and see if you have if already in your local database; if not, it's a new mail.

Outlook uses the same strategy, BTW (see this KB article).




回答2:


As long as your mailbox doesn't keep a copy of the emails on the server then you are fine and don't have to code for this.

Normally when an email client access the emails from a POP3 box they are downloaded and removed from the server.

Exchange is a different thing entirely.

Cheers



来源:https://stackoverflow.com/questions/5960295/how-to-retrieve-only-new-emails-using-pop3-protocol

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!