将邮件标记为未读
如何将电子邮件标记为未读?我知道我可以以只读方式打开流,但在某些情况下我需要操作消息(标记为已查看、移动到不同的文件夹等),因此我需要读取/写入流。我还了解“Seen”标志以及如何删除它。
那么有没有办法在将电子邮件标记为已读后将其标记为未读呢?
以下是从邮件中删除“已看到”标志的代码:
imap_clearflag_full($this->mbox, $mId, '\\Seen', ST_UID);
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);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这适用于 Gmail,已验证:
This works for Gmail, verified:
您是否尝试过:
不要忘记关闭连接。
此处未测试,但可能有效..
Have you tried:
Don't forgot to close the connection.
Not tested here, but may work..
尝试下面的代码:
Try code below: