Thu Ra Thu Ra - 2 months ago 15
PHP Question

yii mailer extension: how to send multiple email addresses at once

Q : How can I send multiple addresses at once?

status : I am using the mailer extension. It is working when I send to single address. But when I send to multiple addresses. It isn't working.

This one is working.

$mailer->AddAddress("aa@gmail.com");


followings are not working.

$mailer->AddAddress("aaa@gmail.com, bbbb@gmail.com");
$mailer->AddAddress("'aaa@gmail.com', 'bbbb@gmail.com'");
$mailer->AddAddress("\"aaa@gmail.com\", \"bbbb@gmail.com\"");

Answer

You just have to call the "addAddress" function multiple times:

$mailer->AddAddress("aaa@gmail.com");
$mailer->AddAddress("bbbb@gmail.com");