Pergunta

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?

Foi útil?

Solução

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();
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top