[英]Marking an email unread in PHP IMAP
To mark an email message as unread, you should unset the \\\\Seen
flag on that message.要将电子邮件标记为未读,您应该取消设置该邮件上的\\\\Seen
标志。
You could use theimap_clearflag_full
function to clear message flags.您可以使用imap_clearflag_full
函数来清除消息标志。
// Unset desired flag
imap_clearflag_full($imap_connection, $message_number, "\\Seen");
// Confirm changes
imap_close($imap_connection, CL_EXPUNGE);
Note:笔记:
"I am checking the mail using some IMAP functions that return the messages as read" “我正在使用一些 IMAP 函数检查邮件,这些函数将消息返回为已读”
You can set the FT_PEEK
flag when reading messages, this will not set the \\\\Seen
flag if not already set.您可以在阅读消息时设置FT_PEEK
标志,如果尚未设置,则不会设置\\\\Seen
标志。
// This will not mark a message as seen
$body = imap_body($imap_stream, $msg_number, FT_PEEK);
imap_clearflag_full($mailbox, $email_number, "\\Seen");
试试 imap_setflag_full, http: //www.php.net/manual/en/function.imap-setflag-full.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.