+1 vote

I'm having an issue hopefully you would be able to help.

I am trying to flag an email as starred. This works fine using the FlagMessageByUID(myUID, Flag.Flagged) method.

The problem is that I cannot find a method for removing this flag. I have tried with FlagMessageByUID(myUID, Flag.Unflagged), but this doesn’t seem to remove the flag and the email remains starred in Gmail.

Looking forward to your feedback.


1 Answer

0 votes
Best answer

Use Imap.UnflagMessageByUID.

Negative flags, like Flag.Unflagged, should not be used with Imap.FlagMessageByUID and Imap.UnflagMessageByUID.

by (296k points)