php imap如何使用imap_sort获取过去7天的未读邮件?

时间:2015-01-19 08:30:17

标签: php imap

是否可以获取过去7天的未读消息。 ?我有

 $result = imap_sort($imap, SORTDATE, 1,"UNSEEN");

2 个答案:

答案 0 :(得分:1)

试试这个,

$msg = imap_search( $imap, "SINCE Mon, 12 Jan 2015 0:00:00 UNSEEN")

并检查以下链接

Need Help on IMAP INBOX Search based on received date

答案 1 :(得分:1)

我找到了答案:

$date = date ( "d M Y", strToTime ( "-7 days" ) );
$search_criteria = "SINCE \"$date\""." UNSEEN";