PHP Mail: inhalt wird bei gmx als attachment angezeigt? Hallo zusammen...
habe folgendes Problem, ich verschicke per PHP mit mail eine Email, inklusive generiertem PDF File.
In Outlook und im Mail Programm von Vista wird alles korrekt inklusive Anhang dargestellt.
Bei GMX allerdings, wird der Inhalt der Email als Attachment angezeigt. Das PDF File wird korrekt übermittelt.
Wieso zeigt GMX mir den Inhalt nur als Attachement?
Quellcode:
<?php
$boundary = strtoupper(md5(uniqid(time())));
$mail_header = "From:blabla <$from>\n";
$mail_header .= "MIME-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";
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: text/parse";
$mail_header .= "\nContent-Transfer-Encoding: 8bit";
$mail_header .= "\n\n$message";
$file_content = fread(fopen($file,"r"),filesize($file));
$file_content = chunk_split(base64_encode($file_content));
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: application/octetstream; name=\"$file_name\"";
$mail_header .= "\nContent-Transfer-Encoding: base64";
$mail_header .= "\nContent-Disposition: attachment; filename=\"$file_name\"";
$mail_header .= "\n\n$file_content";
$mail_header .= "\n--$boundary--";
mail($to,"Ihre Nennung auf blabla",$message,$mail_header);
?> |