Hello,
/********************************************** First File ********************************************/
$fileatt = ""; // Path to the file
$fileatt_type = "application/octett-stream"; // File Type
$fileatt_name = "Test.pdf"; // Filename that will be used for the file as the attachment$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
echo "<p>Dateigroesse: ".strlen($data)."</p>\n"; ### zur Kontrolle
fclose($file);
$data = chunk_split(base64_encode($data));
echo "<pre>\n";
echo $data; ### Zur Kontrolle
echo "</pre>\n";
$email_message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name="{$fileatt_name}"\n" .
"Content-Disposition: attachment;\n" .
" filename="{$fileatt_name}"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}\n";
Bau mal bitte die Kontrollen ein.
Außerdem sind die vorgeschriebenen Zeilenumbrüche für Mail-Header "CrLf" also 0D 0A
Harzliche Grüße vom Berg
http://www.annerschbarrich.de
Tom
Fortschritt entsteht nur durch die Auseinandersetzung der Kreativen
Nur selber lernen macht schlau
