1
我有這樣的代碼它完美....我唯一的問題是imap_setflag_full($imap,$i, "\\Seen");
所看到的標誌似乎並沒有被設置..PHP IMAP - imap_setflag_full
$imap = imap_open("{mail.xyz.com:993/imap/ssl/novalidate-cert}INBOX", "username", "pass");
$message_count=2;
for ($i = 1; $i <= $message_count; ++$i) {
$header = imap_header($imap, $i);
$body = trim(substr(imap_body($imap, $i), 0, 1000));
$prettydate = date("jS F Y", $header->udate);
echo "<pre>".print_r($header)."</pre>";
if (isset($header->from[0]->personal)) {
$personal = $header->from[0]->personal;
} else {
$personal = $header->from[0]->mailbox;
}
$email = "$personal < ".$header->from[0]->mailbox."@".$header->from[0]->host." >";
echo "On $prettydate, $email said \"$body\".\n <BR>";
imap_setflag_full($imap,$i, "\\Seen"); // Set the flag "Seen"
}
imap_close($imap);
我打印頭在我嘗試設置標誌並且不顯示之後。然而,如果我累imap_setflag_full($imap,$i, "\\Flagged");
被標記的測地儀將是F,如果把imap_clearflag_full($imap,$i,'\\Flagged')
F將被刪除...唯一的問題是SEEN和UNSEEN ...任何幫助表示讚賞。
感謝