Hallo,
ich hab hier ein Script, dass nicht ganz funktioniert. Es wird statt dem Anhang dies hier gesendet:
Anfrageformular <info@domain.de>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=b6b8671f2d2774b06ba59451ea6c1cc1
This is a multi-part message in MIME format
--b6b8671f2d2774b06ba59451ea6c1cc1
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
Anfrage von Herr/Frau/Firma:
Textfeld8
--b6b8671f2d2774b06ba59451ea6c1cc1
Content-Type: image/jpeg; name=./for_temp_files/Humpback Whale.jpg
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=./for_temp_files/Humpback Whale.jpg
--b6b8671f2d2774b06ba59451ea6c1cc1--
Hier das Script:
Kann mir da jemand weithelfen?
ich hab hier ein Script, dass nicht ganz funktioniert. Es wird statt dem Anhang dies hier gesendet:
Anfrageformular <info@domain.de>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=b6b8671f2d2774b06ba59451ea6c1cc1
This is a multi-part message in MIME format
--b6b8671f2d2774b06ba59451ea6c1cc1
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
Anfrage von Herr/Frau/Firma:
Textfeld8
--b6b8671f2d2774b06ba59451ea6c1cc1
Content-Type: image/jpeg; name=./for_temp_files/Humpback Whale.jpg
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=./for_temp_files/Humpback Whale.jpg
--b6b8671f2d2774b06ba59451ea6c1cc1--
Hier das Script:
PHP-Code:
$Dateiname = "".$_SESSION['upload']."";
$DateinameMail = "./for_temp_files/".$_SESSION['upload']."";
$Header = "Anfrageformular <info@schober-verpackungen.de>";
$Trenner = md5(uniqid(time()));
$Header .= "\n";
$Header .= "MIME-Version: 1.0";
$Header .= "\n";
$Header .= "Content-Type: multipart/mixed; boundary=$Trenner";
$Header .= "\n\n";
$Header .= "This is a multi-part message in MIME format";
$Header .= "\n";
$Header .= "--$Trenner";
$Header .= "\n";
$Header .= "Content-Type: text/plain";
$Header .= "\n";
$Header .= "Content-Transfer-Encoding: 8bit";
$Header .= "\n\n";
$Header .= "Anfrage von Herr/Frau/Firma:
$Header .= "Textfeld".$_SESSION['textfeld']."";
$Header .= "\n";
$Header .= "--$Trenner";
$Header .= "\n";
if(file_exists("./for_temp_files/".$_SESSION['upload'].""))
{$Header .= "Content-Type: image/jpeg; name=$DateinameMail";
$Header .= "\n";
$Header .= "Content-Transfer-Encoding: base64";
$Header .= "\n";
$Header .= "Content-Disposition: attachment; filename=$DateinameMail";
$Header .= "\n\n";
$Dateiinhalt = fread(fopen($Dateiname, "r"), filesize($Dateiname));
$Header .= chunk_split(base64_encode($Dateiinhalt));
$Header .= "\n";
$Header .= "--$Trenner--";
}
mail($email, $betreff, "", $Header);
Kommentar