Mail mit PDF-Anhang - nix geht mehr

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

Mail mit PDF-Anhang - nix geht mehr

Postby Fox77 » 23. November 2006 15:28

Ich habe ein problem mit PDF-anhang in ein PHP-script auf meinen lokalen XAMPP instalation (XP SP2). Auf meinen (unix) webserver klappt's aber.

Wenn ich versuche folgendes script auszuführen hängt sich der Apache auf:

$message="blabla";
$file="blabla.pdf";
$filename="name";
$boundary = md5(uniqid(rand()));
$mail_header = "From: me@home.at\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/plain";
$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),76,"\n");
$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--";
if(@mail($woshalthingeht, "bla", $message, $mail_header)) {
$error = "Passt!";
}
else {
$error = "nichts verschickt";
}
echo "$error";

Im Apache error-log ist folgendes zu lesen:

[Thu Nov 23 15:07:38 2006] [crit] (22)Invalid argument: unable to replace stderr with error_log
[Thu Nov 23 15:07:38 2006] [crit] (2)No such file or directory: unable to replace stderr with /dev/null
[Thu Nov 23 15:07:39 2006] [crit] (22)Invalid argument: unable to replace stderr with error_log
[Thu Nov 23 15:07:39 2006] [crit] (2)No such file or directory: unable to replace stderr with /dev/null

Wer weiss was da los ist?? Habe ich etwas übersehen??

lg,
Fox77
 
Posts: 1
Joined: 23. November 2006 14:54

Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 31 guests