Code: Select all
echo "Email sent";
$swift =& new Swift(new Swift_Connection_SMTP("smtp.host.tld"));
$message =& new Swift_Message($title, $contents, "text/html");
$recipients =& new Swift_RecipientList();
while ($row_customers = mysql_fetch_array($res_customers))
{
$recipients->addTo($row_customers['emailadress']);
}
// just to check:
echo "Sent to: ".$recipients;
//NOTE that Cc and Bcc recipients are IGNORED in a batch send
$swift->batchSend($message, $recipients, "me@somedomain.com");