Ich erhalte nach "Senden" keine Mail und werde aufgefordert alle Formularfelder auszufüllen. Obwohl alle Felder ausgefüllt sind. Bitte helft mir weiter.
Code:
<?php
$Empfaenger = "mein@gmx.net";
// if (isset($_POST['send']))
if($_REQUEST['Send'])
{
if(empty($_REQUEST['name']) || empty($_REQUEST['nachricht']) || empty($_REQUEST['email']) || empty($_REQUEST['tel']) || empty($_REQUEST['model']) || empty($_REQUEST['firstuse']) || empty($_REQUEST['color']) || empty($_REQUEST['kilometer']))
{
echo"Please go <a href=\"javascript:history.back();\">BACK</a> and fill out all filds!";
}
else
{
$Mailbetreff = "Kontakt: ";
$Mailbetreff .= $_REQUEST['Betreff'];
$Trenner = md5(uniqid(time()));
$Header = "From: ".$_REQUEST['Email'];
$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 .= "You got a e-Mail: \n\n";
while(list($Formularfeld, $Wert)=each($_REQUEST))
{
if($Formularfeld!="Send" && $Formularfeld!="Anhang")
{
$Header .= $Formularfeld.": ".$Wert."\n";
}
}
$Header .= "\nDatum/Zeit: ";
$Header .= date("d.m.Y H:i:s");
$Header .= "\n";
$Header .= "--$Trenner";
$Header .= "\n";
$Header .= "Content-Type: ";
$Header .= $_FILES['Anhang']['type'];
$Header .= "; name=";
$Header .= $_FILES['Anhang']['name'];
$Header .= "\n";
$Header .= "Content-Transfer-Encoding: base64";
$Header .= "\n";
$Header .= "Content-Disposition: attachment; filename=";
$Header .= $_FILES['Anhang']['name'];
$Header .= "\n\n";
$Dateiinhalt = fread(fopen($_FILES['Anhang']['tmp_name'], "r"), $_FILES['Anhang']['size']);
$Header .= chunk_split(base64_encode($Dateiinhalt));
$Header .= "\n";
$Header .= "--$Trenner--";
mail($Empfaenger, $Mailbetreff, "", $Header);
echo"Thanks for your E-Mail!";
}
}
else
{
?>