Für die, die es interessiert:
PHP-Code:
// Mail holen
$check = imap_check($mailbox);
echo $check->Date."
<br>\n
Anzahl der Nachrichten: ".$check->Nmsgs."<br>\n
Anzahl neue Nachrichten: ".$check->Recent."<br>\n";
// Mail auslesen
$nMessages = imap_num_msg($mailbox);
for($i = 1; $i <= $nMessages; $i++)
{
$header = imap_header($mailbox, $i);
echo "
date: ".$header->Date."<br>\n
to: ".$header->to[0]->personal." <i>".$header->toaddress."</i><br>\n
subject: ".$header->subject."<br>\n
from: ".$header->from[0]->personal." <i>".$header->from[0]->mailbox."@".$header->from[0]->host."</i><br>\n";
$body = imap_body($mailbox,$i);
// echo "<pre>".$body."</pre>";
//Das ist die entscheidene Zeile
$fheader = imap_fetchheader($mailbox,$i);
$f_h = explode("\n", $fheader);
for($j=0;$j<count($f_h);$j++)
{
if (strstr($f_h[$j], "X-Request-Code: "))
{
$x_code[] = str_replace("X-Request-Code: ", "", $f_h[$j]);
}
if (strstr($f_h[$j], "X-Request-Object: "))
{
$x_object[] = str_replace("X-Request-Object: ", "", $f_h[$j]);
}
}
echo "X-Request-Code: ".$x_code[0]."<br>\n";
echo "X-Request-Object: ".$x_object[0]."<br>\n";
echo"<hr>\n";
}
Einen Kommentar schreiben: