Question

I use OpenPop to read emails from a POP3 mail server, but it doesn't read emails in order. How do I get the most recent email?

Was it helpful?

Solution

I using Mail.dll (mark emails as seen (read) using Mail.dll .NET IMAP library and IMAP protocol.)

using(Imap imap = new Imap())
{
imap.Connect("imap.example.com");    // or ConnectSSL for SSL
imap.Login("user", "password");

imap.SelectInbox();
List<long> uids = client.Search(Flag.Unseen);
if (uids.Count > 0)
    client.MarkMessageSeenByUID(uids[0]);
    imap.Close();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top