Everything looks correct. You might want to try echoing the individual headers to make sure they contain what you’re expecting (e.g.,
The only other thing I can think of is that somehow the headers are being striped or changed by the mail server that you’re using to send email. If you’re setting the headers properly but the email arrives with something different, then something is happening between the PHP code and the email being received by the recipient server.
I just checked some of my own code, and I’m using it exactly like my example above and the emails sent out are received with the email address in the proper Cc header.
Also, it appears that the correct syntax for the Cc header is “
Cc“, but you might want to try changing it to “
cc” just for kicks.
Just to make sure I’ve got this right, the email address(es) in the Cc field are received by the recipient, but they appear in the To field instead of the Cc field, correct? What version of PEAR::Mail are you using?