facebooktwittermenuarrow-up

GemBox Support Forum

Does ImapClient.GetMessage change the *seen* attribute?

When loading an email via ImapClient.GetMessage, it seems that the Seen attribute is set to true on the server (ImapMessageFlags).

At least, after loading unread emails via the ImapClient, the corresponding emails are marked as read in my Gmail inbox.

Could this be changed, so that this flag is (optionally?) untouched? Or is it a property of Gmail to mark emails as read whenever they are downloaded via an imap client?

Thanks, Thomas

Hi,

We have now added ImapClient.PeekMessage methods, please try using it instead.
You can download the latest version from our BugFixes page or NuGet.

Does this solve your issue?

As an FYI, when retrieving an email with ImapClient.GetMessage (instead of ImapClient.PeekMessage) you would need to remove the “SEEN” flag if you want to leave an email as unread, like this:

// Retrieve unread email.
MailMessage unreadEmail = imap.GetMessage(uid);

// Remove the "SEEN" flag from read email.
imap.RemoveMessageFlags(uid, ImapMessageFlags.Seen);

Regards,
Mario

Thanks, Mario!
The new PeekMessage method works great!
Best, Thomas