PHP将cc插入邮件功能 [英] PHP insert cc into mail function

查看:229
本文介绍了PHP将cc插入邮件功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

PHP邮件,CC字段

我正在使用以下php发送电子邮件。我需要在我的电子邮件中添加cc。当我尝试插入标题时,html消息显示原始的html。什么是处理cc的最佳方法?

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?

谢谢

$headers = "From: $from_email\r\nReply-To: $from_email";

$headers .= "Return-Path: <info@premierinspectiontn.com>";

//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";


推荐答案

刚刚测试过,它的工作原理如下: / p>

just tested this, and it worked as expected:

                    $headers .= 'Cc: test@test.com\r\n';
                    $headers .= 'Bcc: test@test.com\r\n';

我还建议将您的回车符和新行移到上一个条目的末尾$头

I would also suggest moving your carriage return and new line to the end of the previous entry to $headers

$headers = "From: $from_email\r\nReply-To: $from_email";
$headers .= 'Cc: test@test.com\r\n';
$headers .= 'Bcc: test@test.com\r\n';
$headers .= "Return-Path: <info@premierinspectiontn.com>\r\n";

//add boundary string and mime type specification
$headers .= "Content-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";

希望有助于

这篇关于PHP将cc插入邮件功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆