+2 votes

Hi

Is it possible to set the star / flag on an email in Gmail?

I would like to mark emails with stars so show its been processed.

by

1 Answer

0 votes
 
Best answer

You simply use FlagMessageByUID method:

using (Imap imap = new Imap())
{
imap.ConnectSSL("imap.gmail.com");
imap.UseBestLogin("pat@gmail.com", "password");

imap.SelectInbox();
long last = imap.GetAll().Last();

imap.FlagMessageByUID(last, Flag.Flagged);

imap.Close();

}

You can also use labels for that purpose:
https://www.limilabs.com/blog/label-message-with-gmail-label

This way you can mark messages that were processed successfully in a different way than those where your application encountered some errors.

by (301k points)
...