views:

783

answers:

1

ok, i don't know how the data should be formatted for AddAddress PHPMailer function; i need the email to be sent to multiple recipients so i tried

$to = "[email protected],[email protected],[email protected]";
$obj->AddAddress($to);

but with no success. any help will be appreciated. thanks

+3  A: 

i think that you need to call the AddAddress function once for each E-Mail address you want to send to.As far as I know there are only two arguments for this function: recipient email address and recipient name. The recipient name is optional and will not be used if not present.

$mailer->AddAddress('[email protected]', 'First Name');
$mailer->AddAddress('[email protected]', 'Second Name');
$mailer->AddAddress('[email protected]', 'Third Name');

you could use an array to store the recipients and then use a for loop. Hope it helps.

doamnaT