Mailkit: How do you delete a message using IMAP client?

Created on 18 Aug 2017  路  1Comment  路  Source: jstedfast/MailKit

I have a need to search for a message based on a unique subject and if i find it, delete the message. How do i accomplish the delete part? searching for messages was self-explanatory. I can't seem to find a way to delete the message once i've found it.

question

Most helpful comment

What you need to do is to set the MessageFlags.Deleted flag on the message via folder.AddFlags (uid, MessageFlags.Deleted, true);

You may also want to purge the folder of deleted messages using folder.Expunge ();

>All comments

What you need to do is to set the MessageFlags.Deleted flag on the message via folder.AddFlags (uid, MessageFlags.Deleted, true);

You may also want to purge the folder of deleted messages using folder.Expunge ();

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rhagh picture rhagh  路  5Comments

jstedfast picture jstedfast  路  4Comments

SpiritBob picture SpiritBob  路  4Comments

dbogatov picture dbogatov  路  7Comments

spchaplin picture spchaplin  路  3Comments