POP3 protocol does not have a concept on unread messages.
You have to mark which message has been read by yourself on the client application.
Below is an example that downloads email messages using POP3. You must provide your own WasReceived method implementation, which checks if specified uid was already processed and stores this uid if it wasn't:
using (Pop3 pop3 = new Pop3())
{
pop3.Connect("pop3.example.com");
pop3.Login("user", "password");
MailBuilder builder = new MailBuilder();
foreach (string uid in pop3.GetAll())
{
Console.WriteLine("Message unique-id: {0};", uid);
if (WasReceived(uid) == true)
continue;
IMail email = builder.CreateFromEml(
pop3.GetMessageByUID(uid));
Console.WriteLine(email.Subject);
Console.WriteLine(email.Text);
}
pop3.Close();
}
private static bool WasReceived(string uid)
{
// Here you should check if this uid was already received.
// Store this uid for future reference if it wasn't.
throw new NotImplementedException();
}
If you are using Gmail make sure you understand how Gmail's POP3 works:
https://www.limilabs.com/blog/gmail-pop3-behavior