2013-10-07 83 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电子邮件包含给用户。

相关问题