+1 vote

I am retrieving emails using the IMAP interface, creating the IMail objects with: IMail mail = new MailBuilder().CreateFromEml(eml);
Is there a way to determine if that message has been marked read?
I cannot find anything in samples. Could you point me to some information?


1 Answer

0 votes
Best answer

The eml data you get from the server don't contain this information. They contain raw eml - same for POP3 and IMAP servers. Seen/Unseen status is stored on the server not in the email message itself.

You can use Imap.GetMessageInfoByUID method to download most common email data -including server flags. It returns single MessageInfo or list of MessageInfo instances in case of many uids passed.

You can then examine MessageInfo.Flags collection. Seen messages are going to have Flag.Seen present in this collection.

You can also use GetMessasgeFlagsByUID if you are interested in flags only.

by (276k points)