PHPMailer sending to multiple address

匆匆过客 提交于 2019-12-25 05:48:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!