PHP mailer multiple address [duplicate]
You need to call the AddAddress
method once for every recipient. Like so:
$mail->AddAddress('person1@domain.com', 'Person One');$mail->AddAddress('person2@domain.com', 'Person Two');// ..
Better yet, add them as Carbon Copy recipients.
$mail->AddCC('person1@domain.com', 'Person One');$mail->AddCC('person2@domain.com', 'Person Two');// ..
To make things easy, you should loop through an array to do this.
$recipients = array( 'person1@domain.com' => 'Person One', 'person2@domain.com' => 'Person Two', // ..);foreach($recipients as $email => $name){ $mail->AddCC($email, $name);}