PHP在邮件函数中插入抄送
可能的重复:
PHP 邮件、抄送字段
我正在使用以下 php 发送电子邮件。我需要将抄送添加到我的电子邮件中。当我尝试插入标头时,html 消息显示原始 html。处理抄送的最佳方式是什么?
谢谢
$headers = "From: $from_email\r\nReply-To: $from_email";
$headers .= "Return-Path: <[email protected]>";
//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";
Possible Duplicate:
PHP Mail, CC Field
I am using the following php to send an email. I need to add cc to my email. When I try to insert into header the html message show the raw html. What is the best way to handle a cc?
Thanks
$headers = "From: $from_email\r\nReply-To: $from_email";
$headers .= "Return-Path: <[email protected]>";
//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
刚刚对此进行了测试,它按预期工作:
我还建议将回车符和新行移动到
$headers
的上一个条目的末尾希望有帮助
just tested this, and it worked as expected:
I would also suggest moving your carriage return and new line to the end of the previous entry to
$headers
hope that helps
尝试添加
Try adding