我为客户建立了一个简单的PHP脚本给我发电子邮件,效果很好。但我想在剧本中添加一个自动回复说:
Thank you for your interest. We will get back to you as soon as possible.
Sincerely,
(My Name)
这是我已经使用的脚本:
// ******* PROCESS EMAILS
$emailSubject = '*** Business Lead - '.$_POST['full_name'].' ***';
$webMaster = 'my@email.com';
//Gather Info
$leadname = $_POST['full_name'];
$leademail = $_POST['email'];
$leadphone = $_POST['phone'];
$leadip = $_SERVER['REMOTE_ADDR'];
$body = <<<EOD
<br><hr><br>
<b>***** $emailSubject ***</b><br>
<br><hr><br>
<b>Name:</b><br>
$leadname <br><br>
<b>Email:</b><br>
$leademail <br><br>
<b>Phone:</b><br>
$leadphone <br><br>
<b>IP Address:</b><br>
$leadip <br><br>
EOD;
$headers = "From: $leademail\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
// ******* PROCESS EMAILS
有什么我可以添加到这个已添加到文本中的不是太多的代码吗?先感谢您。 :)
答案 0 :(得分:4)
那将是:
$message = "Thank you for your interest. We will get back to you as soon as possible.<br />Sincerely,<br />(My Name)";
$subject = "Confirmation";
$headers2 = "From: $webMaster\r\n";
$headers2 .= "Content-type: text/html\r\n";
mail($leademail, $subject, $message, $headers2);