IMAP and PHP
| From: | Thomas Strecker | Date: | Sat, 09 Sep 2000 14:56:38 +0000 |
| Subject: | IMAP and PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15991@lists.php.net to get a copy of this message | ||
I have code which looks like this (taken from a book):
<html>
<head>
<title>Testabfrage POP3 Server</title>
</head>
<body>
<?php
$user = "myname";
$pass = "mypasswd";
$mb = imap_open("{mail.cs.tu-berlin.de/pop3}INBOX", $user, $pass);
if ($mb)
{
$check = imap_check($mb);
echo("Datum : " . $check->Date."<br>\n");
echo("Verbindung : ".$check->Driver."<br>\n");
echo("Mailbox : ".$check->Mailbox."<br>\n");
echo("Anzahl Emails : ".$check->Nmsgs."<br>\n");
echo("Aktuell : ".$check->Recent."<br>\n");
echo("<hr>\n");
for ($i = 1; i<= imap_num_msg($mb); $i++)
{
echo($i);
$header = imap_header($mb, $i);
echo("Datum : ".$header->date."<br>\n");
echo("An : ".$header->to."<br>\n");
echo("Von : ".$header->from."<br>\n");
echo("CC : ".$header->cc."<br>\n");
echo("Antwort : ".$header->reply_to."<br>\n");
echo("Betreff : ".$header->subject."<br>\n");
echo("<br>\n");
echo("<pre>\n");
echo(imap_body($mb, $i)."</pre>\n<hr>\n");
}
imap_close($mb);
}
?>
</body>
</html>
the page which is built either returns with a "document contained no
data" error or only delivers the first message (even if there are more
available). Now my question is whether the code is wrong (wouldn't be
the first mistake in the book) or some other proböem exists.
thanx for your help
icarus