wen es interessiert, bei mir klappt das hervorragend so:
PHP-Code:
$mail_header = "From: $von";
/* boundary */
$boundary = strtoupper(md5(uniqid(time())));
/* MIME-mail-header */
$mail_header .= "\nMIME-Version: 1.0";
$mail_header .= "\nContent-type: multipart/mixed; boundary=$boundary";
$mail_header .= "\n\nThis is a multi-part message in MIME format -- Dies ist eine mehrteilige Nachricht im MIME-Format";
/* Hier faengt der normale Mail-Text an */
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-type: $content_type_s";
$mail_header .= "\nContent-Transfer-Encoding: 8bit";
$mail_header .= "\n\n$mail_content";
/* Hier faengt der Datei-Anhang an */
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-type: $anhang_content_type; name=\"$dateiname\"";
/* Lese aus dem Array $contenttypes die Codierung fuer den MIME-Typ des Anhangs aus */
$mail_header .= "\nContent-Transfer-Encoding: ".$encoding;
$mail_header .= "\nContent-Disposition: attachment; filename=\"$dateiname\"";
$mail_header .= "\n\n$datei_content";
/* Gibt das Ende der eMail aus */
$mail_header .= "\n--$boundary--";
$content_type_s = "text/html" oder "text/plain"
$mail_content ist der eigentliche mailtext (html-text)
$anhang_content_type = "image/gif" oder was da halt drann hängt
$dateiname = name des attachments, wie er angezeigt werden soll