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 Exp开发者_C百科ress 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.
You have to store the UIDL
of each email in a local database. When you want to check for new mail, you retrieve the UIDL
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).
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
精彩评论