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?
source
share