+3 votes

Part of our Email to Database process requires that we make a distinction between READ/UNREAD emails.

We are doing something like this

using (Pop3 pop3 = new Pop3())
{
    //Connect or ConnectSSL for SSL
    mailInfo = EGetMailInfo();
    if (!pop3.Connected)
    {
        pop3.Connect(mailInfo[3], Convert.ToInt32(mailInfo[4]));
        pop3.UseBestLogin(mailInfo[5], mailInfo[6]);
    }

    foreach (string uid in pop3.GetAll())
    {
        IMail email = new MailBuilder()
            .CreateFromEml(pop3.GetMessageByUID(uid));

        if (email != null)
            if (email.......)   // test for read/unread
            {
                // do something
            }
    }
}

Can you please assist with the property that identifies READ/UNREAD emails.

by

1 Answer

0 votes
 
Best answer

POP3 protocol doesn't support seen/unseen status.
This is the limitation of POP3 protocol itself, not Mail.dll email library.

You need to use IMAP to be able to recognize, if email was seen or not:

Download only unseen messages only:
https://www.limilabs.com/blog/receive-unseen-emails-using-imap

Use Peek* methods, if you don't want to automatically change status to seen:
https://www.limilabs.com/blog/peek-message-on-imap-server

Download bulk message information (without attachments and body)
including seen/unseen status fast:
https://www.limilabs.com/blog/get-email-information-from-imap-fast

by (297k points)
...