i've a problem with this code:
Code: Select all
<?
$swift =& new Swift(new Swift_Connection_SMTP("localhost"));
$swift->attachPlugin(new Swift_Plugin_AntiFlood(1, 10), "anti-flood");
//Make the script run until it's finished in the background
set_time_limit(0); ignore_user_abort();
echo "<font color=\"#333333\" face=\"Arial, Helvetica, sans-serif\" size=\"+1\">Invio newsletter in corso...</font><br>";
flush(); ob_flush();
$message =& new Swift_Message("My subject", "My body");
$recipients = new Swift_RecipientList();
$recipient = new Swift_Address ("xxx@www.it");
$recipients->addTo ($recipient);
$recipient = new Swift_Address ("yyy@xxx.it");
$recipients->addTo ($recipient);
$num_sent = $swift->send($message, $recipients, "www@www.com");
echo "<font color=\"#333333\" face=\"Arial, Helvetica, sans-serif\" size=\"+1\">Messaggi inviati: <strong>$num_sent</strong></font><br>";
echo "Failed recipients:<br />";
$log =& Swift_LogContainer::getLog();
$log->setLogLevel(3);
echo "---> ".implode(" ,", $log->getFailedRecipients());
$swift->disconnect();
?>Why?
Another question...
How can I send a single mail to every user in my list? Otherway if I use $recipients->addTo ($recipient); they all see all the address.
Thanks
Bob