Thomas
Thomas

Reputation: 21

PHPMailer, CC and Linux server

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.

Upvotes: 2

Views: 2743

Answers (2)

Ricky Disido
Ricky Disido

Reputation: 11

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.

Upvotes: 1

Gazler
Gazler

Reputation: 84150

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. PHPmailer multiple recipients error

Upvotes: 1

Related Questions