问题
I am using PHPMailer to send emails, i use this code to add the email address to send to:
$mail->addAddress("receipent@domain", "receipent");
it works for one email but does not work for multiple email.
i get an error saying
You must provide at least one recipient email address.
回答1:
Just use it multiple times.
$mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient
$mail->addAddress('ellen@example.com');
回答2:
Just call it one time for one address like
mail->addAddress("receipent1@domain", "receipent1");
mail->addAddress("receipent2@domain", "receipent2");
来源:https://stackoverflow.com/questions/32677863/phpmailer-sending-to-multiple-address