+1 vote

I obtain this exception doing what in the subject:
"You can only use non negative flags (e.g. Flag.Seen) with FlagMessage and UnflagMessage methods."

How I can set a message as unseen?

by

1 Answer

0 votes
 
Best answer

Use Imap.MarkMessageSeenByUID and Imap.MarkMessageUnseenByUID methods.
-or-
Don't use negative flags (such as Flag.Unseen) when you invoke FlagMessageByUID and UnflagMessageByUID.

Correct way to do it is to use Flag.Seen:
Imap.FlagMessageByUID(uid, Flag.Seen),
Imap.UnflagMessageByUID(uid, Flag.Seen)

by (301k points)
...