title: PHP Mail adding CC
body: <p>I have this PHP Mail Function:</p>
  
  <pre><code>if(!function_exists("sendemail"))
  {
      function sendemail($email_to,$email_from,$email_subject,$email_body,$email_replyto)
      {
          if(filter_var($email_to, FILTER_VALIDATE_EMAIL))
          {
              require_once "/usr/local/lib/php/Mail.php";
  
              $from = $email_from;
              $to = $email_to;
              $subject = $email_subject;
              $body = $email_body;
  
              $host = "mail.domain.co.uk";
              $username = "sending@domain.co.uk";
              $password = "*******";
  
              $headers = array ('From' =&gt; $from,
                'To' =&gt; $to,
                'Subject' =&gt; $subject,
                'Content-type' =&gt; 'text/html');
              $smtp = Mail::factory('smtp',
                array ('host' =&gt; $host,
               'auth' =&gt; true,
               'username' =&gt; $username,
               'password' =&gt; $password));
  
              $mail = $smtp-&gt;send($to, $headers, $body, $cc);
          }
      }
  }
  </code></pre>
  
  <p>I have added in the ability to CC Email addresses in:</p>
  
  <pre><code>if(!function_exists("sendemail"))
  {
      function sendemail($email_to,$email_from,$email_subject,$email_body,$email_replyto,$cc)
      {
          if(filter_var($email_to, FILTER_VALIDATE_EMAIL))
          {
              require_once "/usr/local/lib/php/Mail.php";
  
              $from = $email_from;
              $to = $email_to;
              $subject = $email_subject;
              $body = $email_body;
  
              $host = "mail.domain.co.uk";
              $username = "sending@domain.co.uk";
              $password = "*******";
  
              $headers = array ('From' =&gt; $from,
                'To' =&gt; $to,
                'Cc' =&gt; $cc,
                'Subject' =&gt; $subject,
                'Content-type' =&gt; 'text/html');
              $smtp = Mail::factory('smtp',
                array ('host' =&gt; $host,
               'auth' =&gt; true,
               'username' =&gt; $username,
               'password' =&gt; $password));
  
              $mail = $smtp-&gt;send($to, $headers, $body, $cc);
          }
      }
  }
  </code></pre>
  
  <p>but it only seems to add the CC'd email address(es) into the header and not send the email. it only sends the email to the address in the $email_to variable</p>
  
  <p>Any ideas how i can get the CC working?</p>