I am using the PEAR Mail module to send mail. I am able to send mail just fine, with one exception. For some reason, the Cc function does not work. I see email3 being CC'ed in the mail to the original mail recipient (email2), but the person being CC'ed does not get it (email3). Does anyone have any idea why and how to fix it? The code is below:
<?php
require_once "/usr/share/pear/Mail.php";
$from = "email1@somewhere.com";
$to = "email2@somewhere.com";
$cc = "email3@somewhere.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "smtp.some-server.com";
$username = "";
$password = "";
$headers['From']=$from;
$headers['To']=$to;
$headers['Subject']=$subject;
$headers['Cc']=$cc;
$auth['host']=$host;
$auth['auth']=false;
$smtp=Mail::factory('smtp',$auth);
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail))
{
echo("<p>" . $mail->getMessage() . "</p>");
}
else
{
echo("<p>Message successfully sent!</p>");
}
?>