Ich habe lange gesucht und auch ein paar Themen gefunden, wurde aber nicht schlau daraus!
Wie kann ich bei einem über IMAP abgerufenes Mail den Mail-Anhang downloaden -> <a href=..... >Anhang downloaden</a>
hier noch der quelltext:
(Was muss ich wo einbauen?)
Wie kann ich bei einem über IMAP abgerufenes Mail den Mail-Anhang downloaden -> <a href=..... >Anhang downloaden</a>
hier noch der quelltext:
(Was muss ich wo einbauen?)
Code:
<?php
$mbox = imap_open("{localhost:143}INBOX", "$Mailbox", "$Passwort");
$mailHeader = @imap_headerinfo($mbox, $Mail);
$from = $mailHeader->fromaddress;
$subject = strip_tags($mailHeader->subject);
$date = $mailHeader->date;
$body = nl2br(strip_tags(imap_body($mbox, $Mail)));
$body = imap_utf8($body);
$body = utf8_decode($body);
print "<table><tr><td width=50><font face=Arial size=-2>Von:</font></td><td><font face=Arial size=-1>$from</font></td></tr><tr><td><font face=Arial size=-2>Betreff:</font></td><td><b><font face=Arial size=-1 color=red>$subject</font></b></td></tr><tr><td><font face=Arial size=-2>Anhang:</font></td><td><font face=Arial size=-1 color=red>
[COLOR=red]<a href=..... >Anhang downloaden</a>[/COLOR]
</font></td></tr><tr><td><font face=Arial size=-2>Datum:</font></td><td><font face=Arial size=-1>$date</font></td></tr><tr><td></td><td><font face=Arial size=-1><font color=white>-</font><p>$body</font></td></tr></table>";
imap_setflag_full($mbox, imap_uid($mbox, $Mail),"\\Seen \\Flagged", ST_UID);
}
?>