SO
$mail_header = „From:Test \n“;
$mail_header .= „MIME-Version: 1.0“;
/// wichtig
$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/plain“;
$mail_header .= „\nContent-Transfer-Encoding: 8bit“;
$mail_header .= „\n\n$message“;
$mail_header .= „\n–$boundary“;
//wichtig
$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,„Betreff“,$message,$mail_header);