How to get unread / new messages from Gmail using POP3?

Using the OpenPOP.net client to receive messages from Gmail.

I am wondering how can I get only new messages?

Currently, I get an atom channel, and then I get as many letters as there is a channel with an OpenPOP client (starting from the first).

    GmailAtomFeed feed = new GmailAtomFeed("user", "pass");
    feed.GetFeed();

    int unread = feed.FeedEntries.Count;

    POPClient client = new POPClient("pop.gmail.com", 995, "user", "pass", AuthenticationMethod.USERPASS, true);



    for (int i = 0; i < unread; i++)
    {
        Message m = client.GetMessage(i, false);

        // ...
    }

Is there a better way to do this?

And how do I set up reading unread messages?

+3
source share
2 answers

I doubt you can do this with pop3. From my understanding, POP3 does not support the concept of unread \ unseen email. The client must track messages that have already been shown to the user and which are not.

, IMAP gmail. , gmail IMAP Gmail.

, #, IMAP \opensource: , codeproject: IMAP, #. , "" select.

+5

UIDL . , UIDL , , ; , .

Outlook .

Q POP3

+1

Source: https://habr.com/ru/post/1728736/


All Articles