2013-10-07 133 views
0

我使用我已購買的聯繫表單中的以下代碼;

$address = "myEmailAddress here"; 
$e_subject = 'Footie Tote from ' . $name . '.'; 
$e_body = "You have received scores from $name, with the following details;\n 

Match A: $matcha\n 
Match B: $matchb\n 
Match C: $matchc\n 
Match D: $matchd\n 
Match E: $matche\n 
Match F: $matchf\n 
Match G: $matchg\n 
Match H: $matchh\n 

Name: $name\n 

Email: $email\n 

" . PHP_EOL . PHP_EOL; 
$msg = wordwrap($e_body . $e_content . $e_reply, 70); 
$headers = "From: $email" . PHP_EOL; 
$headers .= "Reply-To: $email" . PHP_EOL; 
$headers .= "MIME-Version: 1.0" . PHP_EOL; 
$headers .= "Content-type: text/plain; charset=utf-8" . PHP_EOL; 
$headers .= "Content-Transfer-Encoding: quoted-printable" . PHP_EOL; 
if(mail($address, $e_subject, $msg, $headers)) { etc. 

我想也有發送到另一個電子郵件地址,這是有人已經進入書($電子郵件值)的電子郵件地址的電子郵件,所以它就像他們所得到的副本提交表單。

有人請指出我在正確的方向來實現這一目標。

+0

感謝您的回覆,這些工作是通過添加$ email的CC/BCC來實現的。爲打破要求的規則而抱歉...下次我將包括我的工作 – hoops78

回答

0

看看the examples in the PHP docs,它看起來像你可以只添加CC標題(或BCC如果你喜歡)。具體看這個頁面上Example#4的標題,你應該可以做這樣的事情:

// ... previous code 
$headers = "From: $email" . PHP_EOL; 
$headers .= "CC: $email" . PHP_EOL; 
$headers .= "Reply-To: $email" . PHP_EOL; 
// ... later code 
0

你可以將其添加爲BCC:

$headers .= "Bcc: $email" . PHP_EOL; 

只需添加下面的從線和應發送密件到$電子郵件

密件使得它如此的不通知用戶的副本。正如大衛所說,CC也會起作用。它只是簡單地將cc電子郵件包含給用戶。

相關問題