2012-09-19 65 views
-3

我建立了一個簡單的PHP腳本,客戶給我發電子郵件,它工作得很好。不過,我想補充一個自動回覆到腳本說:簡單的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 = '[email protected]'; 
//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 

有什麼,我可以添加到這個已添加在文本中是不是太mcuh代碼?先謝謝你。 :)

+5

你嘗試過什麼?你顯然知道如何發送一封郵件,爲什麼你不能發送兩封郵件? –

+0

像@MikeBrant表示,**發送另一封電子郵件**與你想要的... – Jakub

+0

嘆息.......... – dbf

回答

3

這將是:

$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); 
+0

我只是將此添加到腳本的最後的最後一個「//******* PROCESS EMAILS「? – DeeGonz201

+0

是的,它會做到這一點。 – jtheman

+0

^^^謝謝:) – DeeGonz201