我可以向 $to 字段发送电子邮件,但我还必须向用户发送电子邮件,说明他的提交已收到。我必须发送电子邮件到 $_POST["email"]
这是代码
<?php
$ToEmail = 'abc@gmail.com,def@gmail.com';
$EmailSubject = 'Successfull Contact Form Submission';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY = "Name: ".$_POST["fname"]."\r\n";
$MESSAGE_BODY .= "Email: ".$_POST["email"]."\r\n";
$MESSAGE_BODY .= "Company: ".$_POST["company"]."\r\n";
$MESSAGE_BODY .= "Address: ".$_POST["address"]."\r\n";
$MESSAGE_BODY .= "City: ".$_POST["city"]."\r\n";
$MESSAGE_BODY .= "State: ".$_POST["state"]."\r\n";
$MESSAGE_BODY .= "Zip: ".$_POST["zip"]."\r\n";
$MESSAGE_BODY .= "Phone: ".$_POST["phone"]."\r\n";
$MESSAGE_BODY .= "Fax: ".$_POST["fax"]."\r\n";
$MESSAGE_BODY .= "Comment: ".nl2br($_POST["message"])."\r\n";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
?>