PHP-Code:
$postfach = imap_num_msg($mbox);
$num = 1;
while($num <= $postfach)
{
$header = imap_header($mbox, $num);
$mail_to2 = $header->toaddress;
$mail_to = str_replace('_at_', '@', $_GET['mail']);
$mail_to = str_replace('__', '.', $mail_to);
if($mail_to2 == $mail_to)
{
$header = imap_header($mbox, $num);
$from = $header->from;
$betreff = imap_header($mbox, $num, 0);
$betreff = $betreff->subject;
$nachricht = quoted_printable_decode(imap_fetchbody($mbox, $num, 1));
$nachricht = eregi_replace("\r\n\r\n", "<br>" ,$nachricht);
$absender = $from[0]->personal;
$mail = $from[0]->mailbox."@".$from[0]->host;
$datum = $header->udate;
$eintrag = mysql_query("INSERT INTO bodo_at_winmag__de
(betreff, nachricht, absender, absender_mail, datum)
VALUES ('$betreff', '$nachricht', '$absender', '$mail', '$datum')");
$delete = imap_delete($mbox, $num);
}
$num++;
}
Kommentar