电子邮件输入信息中的PHP无法发送

时间:2014-01-26 13:06:04

标签: php forms email

我一直在构建一个带有用户输入的表单,现在有时间通过​​电子邮件发送信息。我收到一封电子邮件,其中包含我在表单中提供的所有信息,但只是没有用户实际输入。

<?php

$name = $_POST['Vorname'];
$firma =$_POST['firma'];
$strasse =$_POST['strasse'];
$email = $_POST['txtEmail'];
$tele = $_POST['tele'];
$fax = $_POST['fax'];
$textarea = $_POST['textarea']; 


$email_to = "kchochlow@gmail.com";

$email_subject = "Information - rietho.de";


$email_from = $email;


$headers =  'From: '.$email."\r\n".

'Reply-To: '.$email."\r\n\n\n" .



$email_subject = "Neue anfrage - Rietho.de";
$email_body = "Sie haben eine neue anfrage von $name arhalten \n\n".


"Name: \n  $name ". 
"Firma: \n  $firma ".
"Addresse: \n  $strasse ". 
"Email: \n  $email". 
"Telefon: \n  $tele ". 
"Fax: \n   $fax ". 

"Die anfrage:\n  $textarea \n\n ". 


'X-Mailer: PHP/' . phpversion();

$mail_sent = @mail($email_to, $email_subject, $email_body, $headers);  

echo $mail_sent ? "Mail sent" : "Mail failed"; 

?>

0 个答案:

没有答案