1

我创建了一个表单来从最终用户那里获取信息并通过电子邮件发送给特定的人。我希望表格也通过电子邮件发送给提交者。一切正常,除非我尝试密件抄送提交者。如果我将该行添加到密件抄送,则不会发送电子邮件。如果我删除密件抄送行,则电子邮件会正确发送,但提交者没有电子邮件副本。这是代码,

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: $email' . "\r\n";
$headers .= 'Bcc: $email_bcc' . "\r\n";
4

2 回答 2

1

Using Bcc in the header should be fine. However, make sure, that your mail server is not killing the mail because of it.1

Check the return value of the mail function. This should return false, if an error occured. If that is the case, you should send an extra mail to the sender.

Windows Server seem to have a problem with this.

于 2015-04-29T13:28:03.083 回答
1

将密件抄送收件人添加到收件人,但不添加到标题!

于 2015-04-29T13:21:07.207 回答