cc在php邮件不工作 [英] cc in php mail not working

查看:82
本文介绍了cc在php邮件不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码发送带有上传文件的表单。但是它使用主邮件正常工作,但不发送cc邮件。

I am using this code to send a form with uploaded file. However It is working fine with primary mail but do not send cc mail.

    $headers = "From: $email";
    $headers .= 'Cc: xyz@gmail.com' . "\r\n";

    // create a boundary string. It must be unique
      $semi_rand = md5(time());
      $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

      // Add the headers for a file attachment
      $headers .= "\nMIME-Version: 1.0\n" .
                  "Content-Type: multipart/mixed;\n" .
                  " boundary=\"{$mime_boundary}\"";

请帮我让它运行。谢谢

推荐答案

你必须尝试这种方式

    $headers =  'From: webmaster@example.com' . "\r\n" ;
    $headers .= 'Cc: xyz@gmail.com' . "\r\n";

这篇关于cc在php邮件不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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