Archived Forum Post

Index of archived forum posts

Question:

Setting "Deleted" Flag does not remove email from IMAP mailbox?

May 04 '16 at 08:19

I hope you can help with a minor problem I have with IMAP component.
I am running this code:

success = imap.SetMailFlag(email, "Deleted",1);

But, when I am quering for new messages, the mail is still received. This happens until I log into the web interface of my mail provider (one.com). After login, the message is no longer retrieved when I query.

Should I do something else than disconnect after calling the SetMailFlag? Flush cache or similar?


Answer

Setting the "Deleted" flag does not remove the email from the mailbox. Emails marked "Deleted" are removed when the Expunge method is called.