views:

228

answers:

2

Hi, how do I add a CC mail address in PHPMailer running on a Linux server?

AddCC method only works on Windows: http://phpmailer.worxware.com/index.php?pg=methods

I tried with this method but the mail never arrives... I also tried with $mail->addCustomHeader('CC: [email protected]') without success.

Thank you.

+1  A: 

I had problems with addCC with PHPMailer when there was already a recipient present. In order to fix this, the safemode of the mail function within PHPMailer had to be removed due to the shared server not allowing it. If you turn on errors you will find where the problem is coming from.

First answer here for reference. http://stackoverflow.com/questions/2277466/phpmailer-multiple-recipients-error

Gazler
A: 

Hello Thomas,

I have added some lines of code in my application. And I call it tricky things. You can add cc in your code as below :

if($ccList != "") { $ccRecipients = explode(",",$ccList); foreach($ccRecipients as $ccRecipient) { $mailer->AddCC($ccRecipient); //$mailer->AddAddress($ccRecipient); } $mailer->AddCustomHeader("Cc: $ccList"); }

You can change the code to meet your appication needs.

I hope it's working for you :)

Thanks.

Ricky Disido