note 110444 modified in function.imap-fetch-overview by danbrown
| From: | danbrown@php.net | Date: | Thu, 06 Dec 2012 14:32:30 +0000 |
| Subject: | note 110444 modified in function.imap-fetch-overview by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192342@lists.php.net to get a copy of this message | ||
If you lost a mail use this
<?php
public function READallUnreadmail(){
if ($headers = imap_check($this->msgbox)){
$lastnr = $headers->Nmsgs;
if ($mails=imap_fetch_overview($this->msgbox,"1:".$lastnr,0)){
while (list($key, $val) = each($mails)) {
if (++$key>=0&&$header= imap_header($this->msgbox, $key)){
if($header->Unseen=='U'||$header->Recent=='R'){
echo "<br>".$val->msgno." -
".$val->date." - ".$val->subject."\n<br>";
print "IREAD".$header->Msgno;
//$this->getattachmentof($header->Msgno);
}
}
}
}
}
}
?>
--was--
If you lost a mail use this
[php]
public function READallUnreadmail(){
if ($headers = imap_check($this->msgbox)){
$lastnr = $headers->Nmsgs;
if ($mails=imap_fetch_overview($this->msgbox,"1:".$lastnr,0)){
while (list($key, $val) = each($mails)) {
if (++$key>=0&&$header= imap_header($this->msgbox, $key)){
if($header->Unseen=='U'||$header->Recent=='R'){
echo "<br>".$val->msgno." -
".$val->date." - ".$val->subject."\n<br>";
print "IREAD".$header->Msgno;
//$this->getattachmentof($header->Msgno);
}
}
}
}
}
}
[/php]
http://php.net/manual/en/function.imap-fetch-overview.php