note 75544 deleted from function.imap-thread by tularis
| From: | tularis@php.net | Date: | Tue, 05 Jun 2007 06:31:58 +0000 |
| Subject: | note 75544 deleted from function.imap-thread by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127212@lists.php.net to get a copy of this message | ||
Note Submitter: cyp AT lipousse DOT no-ip DOT org
Reason: non-english
----
<?php
// Ici nous affichons les threads d'une boite email
$mbox = imap_open("{localhost:143/imap/notls}INBOX",$user,$pass)
or die("Connexion impossible : " . imap_last_error());
$threads = imap_thread($mbox);
foreach ($threads as $key => $val) {
$tree = explode('.', $key);
if ($tree[1] == 'num') {
$header = imap_headerinfo($mbox, $val);
$fromname = $object->personal;
$fromaddress = $object->mailbox . "@" . $object->host;
$subject = $header->Subject;
$date = $header->date;
$body = imap_body($mbox,$val);
echo "<ul>\n\t<li><b>".$subject."</b> :: <a
href=\"".$fromaddress."\">" . $fromname . "</a> ::
".$date."\n
<pre>".$body."</pre>";
} elseif ($tree[1] == 'branch') {
echo "\t</li>\n</ul>\n";
}
}
imap_close($mbox);
?>