抄送PHP邮件发件人()表格
问题描述:
有问题让我的网页副本发送回发件人。抄送PHP邮件发件人()表格
$recipient = "[email protected]";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
$mailheader .= "Cc: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader)
答
请勿使用\ n \ r,只需放入电子邮件。 不要使用$ mailheader。改用:
$mail->From = "[email protected]";
$mail->FromName = "name of a";
$mail->Subject = "subject mail";
$mail->Body = "body mail";
$mail->AddReplyTo("name1", "[email protected]");
$mail->AddAddress("name2", "[email protected]");
$mail->AddCC("name3", "[email protected]");
$mail->AddBCC("name4", "[email protected]");
答
$headers = "MIME-Version: 1.0\n";
$headers .= "From: ".$agent." <".$email.">\n";
$headers .= "cc: ".$email."\n";
$headers .= "Reply-To: Name <[email protected]>\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: My mailer";
这给了我这似乎是为什么它不会CC,现在Gmail中显示正确的CC的家禽,但我似乎被打一下正确的标题是前景或Hotmail地址阻止它,因为我正在使用CCmail的@hotmail。
尝试'$ mailheader'的去除'\ r \ N' [从端部(http://php.net/manual/en/function.mail.php#example-3909)。 – yergo
正常通过,但没有电子邮件发送给抄送:/ –