我正在使用 POP3 协议在 .NET 应用程序中检索电子邮件。我只需要阅读新电子邮件,但在许多博客中发现不可能使用 POP3 检索“未见过”或“新”邮件。这是真的吗?如果是这样,您能帮我了解 Outlook Express 如何使用 POP3 接收新邮件吗?
有什么方法可以标记电子邮件服务器本身中看到的邮件吗?或者请帮我找到一种使用 POP3 协议检索新邮件的方法。
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.
发布评论
评论(2)
您必须将每封电子邮件的
UIDL
存储在本地数据库中。当您想要检查新邮件时,您可以检索服务器上的UIDL
并查看本地数据库中是否已存在;如果没有,这是一封新邮件。Outlook 使用相同的策略,顺便说一句(请参阅此知识库文章)。
You have to store the
UIDL
of each email in a local database. When you want to check for new mail, you retrieve theUIDL
s 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).
只要您的邮箱没有在服务器上保留电子邮件的副本,那么您就可以,无需为此编写代码。
通常,当电子邮件客户端从 POP3 邮箱访问电子邮件时,它们会被下载并从服务器中删除。
交换是完全不同的事情。
干杯
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