I am using php imap class.
In my box I have a lot of mail, but with this script I would retrieve only the unreaded mail.
How can I do it?
if ($mbox=imap_open( "{" . $mailserver . ":" . $port . "}INBOX", $user, $pass ))
{
echo "Connected
";
} else { exit ("Can't connect: " . imap_last_error() ."
"); echo "FAIL!
"; };
if ($hdr = imap_check($mbox)) {
$msgCount = $hdr->Nmsgs;
echo "Ci sono ".$msgCount." mail";
} else {
echo "Failed to get mail";
}
If I do
$overview=imap_fetch_overview($mbox,"1:$msgCount",0);
the script load to an infinity time.
The imap_search UNSEEN solution is not good because pop3 don't use this flag.
So how can I do??????
Thanks a lot.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…