How do I mark a email as unread? I know I can open the stream as read only, but on some occasions I need to manipulate the message (mark as seen, move to a different folder, etc.), so I need the stream to be read/write. I also know about the "Seen" flag and how to remove it.
So is there a way to mark an email as unread after it has been marked as read?
Here is the code which is removing the 'Seen' flag from the mail:
imap_clearflag_full($this->mbox, $mId, '\\Seen', ST_UID);
This works for Gmail, verified:
imap_clearflag_full($mbox, $i, "\\Seen \\Recent");
imap_expunge($mbox);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With