As others say, one mail is better for each recipient.
If you want the library to do the dirty work for you, try SwiftMailer http://swiftmailer.org
Here is an example directly from the docs:
require_once 'lib/swift_required.php';
$transport = Swift_SmtpTransport::newInstance('localhost', 25);
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('john@doe.com' => 'John Doe'))
->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name'))
->setBody('Here is the message itself')
;
$numSent = $mailer->batchSend($message);
printf("Sent %d messages\n", $numSent);
It also has a beautiful Antiflood plugin: http://swiftmailer.org/docs/antiflood-plugin-howto
source
share