title: PHP send email BCC & CC using SMTP
body: <p>I have an PHP code to send email to, cc &amp; bcc.</p>
  
  <p>In this case, the cc is not working.
  I tested it and saw on my email there is no cc email. (BCC email is worked)</p>
  
  <p>Here is my code:</p>
  
  <pre><code>require_once "Mail.php";
  
  $from = "WEBAPPS &lt;donotreply@test.com&gt;";
  $subject = "Calibration will be expiring!";
  
  $host = 'smtp.office365.com';
  $port = '587';
  $username = 'donotreply@test';
  $password = 'w00ew?';
  
  $to = "alwis.david@gmail.com";
  $cc = "data.gw@gmail.com";
  $bcc = "hidayurie.dave@yahoo.com";
  
  $body = "aa";
  
  $headers = array(
  'Port'          =&gt; $port,
  'From'          =&gt; $from,
  'To'            =&gt; $to,
  'Subject'       =&gt; $subject,
  'Content-Type'  =&gt; 'text/html; charset=UTF-8'
  );
  
  $recipients = $to.", ".$cc.", ".$bcc;
  
  $smtp = Mail::factory('smtp',
  array ('host' =&gt; $host,
   'auth' =&gt; true,
   'username' =&gt; $username,
   'password' =&gt; $password));
  
  $mail = $smtp-&gt;send($recipients, $headers, $body);
  
  if (PEAR::isError($mail)) {
     echo("&lt;p&gt;" . $mail-&gt;getMessage() . "&lt;/p&gt;");
  } else {
     echo("&lt;p&gt;Message successfully sent!&lt;/p&gt;");
  }
  </code></pre>
  
  <p>Why CC is not working? and how to solve it?</p>