【发布时间】:2014-03-27 14:11:20
【问题描述】:
我想向填写了我的联系表的客户发送一封自动电子邮件。填写表格后,它会将表格的值发送给我,但不会将电子邮件发送回联系人。这就是我目前所拥有的。
$name = $_POST["fullname"];
$email = $_POST["emailaddress"];
$comments = $_POST["comment"];
$gender = $_POST["gender"];
$age = $_POST["age"];
$Interested = $_POST['Interested'];
$heard = $_POST["Heard"];
$message = "New Email from a customer" .
"\r\nName of the contact" .
"\r\n-". $name .
"\r\nEmail address of the contact" .
"\r\n-".$email .
"\r\nThe comment that the contact has made" .
"\r\n-".$comments .
"\r\nThe gender of the contact" .
"\r\n-".$gender .
"\r\nThe age range of the contact" .
"\r\n-".$age .
"\r\nThe products that the customer is interested in" .
"\r\n-".implode(", " ,$Interested).
"\r\nWhere the contact heard of us" .
"\r\n-".$Heard.
$headers = "From: " . $email;
"Reply-To: \r\n" . $email . " Thank you for your message";
mail("me@localhost",$subject,$message,$headers);
?>
【问题讨论】:
-
我没有看到您尝试发送第二封电子邮件。
-
所以只需添加第二个 mail() 将其发送给客户...?
-
旁注:您的
$headers完全错误。 -
感谢 Tularis 现在整理好了。就是你说的。
-
@Gerald Schneider 为什么他们错了?