提交PHP表单后,我希望一封电子邮件可以发送给多个收件人,但不需要。它仅到达第一个地址。它在电子邮件中说(它正在发送到3个地址的“收件人”字段中,但不是)。如何在此代码中添加抄送或密件抄送(如果需要的话)?
在这里,我已经尝试了所有见过的内容,但是到目前为止,仍然没有任何效果。这是我的代码:
$headers = 'From: CBS Website';
$emailbody = 'Name: '.$_POST['name']."\n"
.'Company: '.$_POST['company']."\n"
.'Email: '.$_POST['email']."\n"
.'Phone: '.$_POST['phone']."\n"
.'Stage: '.$_POST['stage']."\n"
.'Budget Range: '.$_POST['budget']."\n"
.'Geographic Location: '.$_POST['location']."\n"
.'Permanent: '.$_POST['permanent']."\n"
.'Semi-permanent: '.$_POST['semi-permanent']."\n"
.'Special Considerations: '.$_POST['considerations']."\n"
.'Project Type: '.$_POST['projectType']."\n"
.'Square Footage: '.$_POST['sqfootage']."\n"
.'Number of Stories: '.$_POST['stories']."\n"
.'Schedule: '.$_POST['schedule']."\n"
.'SF Budget: '.$_POST['sfbudget']."\n"
.'Future Construction: '.$_POST['futureConst']."\n"
.'Special Features: '.$_POST['features']."\n"
.'Restrictions: '.$_POST['restrictions']."\n"
.'Referral: '.$_POST['referral']."\n";
mail("joedoe@domain.com,janedoe@domain.com,jimmy80@domain.com",'Contact Form Submission', $emailbody, $headers);
echo "<meta http-equiv='refresh' content=\"0; url=thankyou.php\">";