Email's sequence number corresponds to the Date it was stored on the POP3 server. Therefore to fetch the recent TOP 10 emails you can simply iterate from the last sequence number (pop3.GetMessageCount()
) as follows:
Pop3 pop3 = new Pop3();
// connect and login
int start = pop3.GetMessageCount();
int stop = Math.Max(start - 10, 0);
for (int i = start; i > stop; i--)
{
MailMessage mail = pop3.GetMailMessage(i);
Console.WriteLine("{0}: {1}", mail.Date, mail.Subject);
// ...
}
Please note that sequence numbers run from 1 (not 0)