Update database on every mail sent?
Posted: Fri Feb 29, 2008 5:08 pm
Hi,
I have around 5,000 members in my newsletter table. I wish to keep track of mails i.e. to whom mails have been sent and to whom not yet sent.
I am currently using batchsend method to send the mails, following is piece of the code:
Any idea how to id update the database records in this situation?
Thanks in advance.
I have around 5,000 members in my newsletter table. I wish to keep track of mails i.e. to whom mails have been sent and to whom not yet sent.
I am currently using batchsend method to send the mails, following is piece of the code:
Code: Select all
// Fetch the subscribers
$sql2 = mysql_query("SELECT email FROM subscribers WHERE unsubscribe != 'Y'");
$recipients =& new Swift_RecipientList();
while ($row2 = mysql_fetch_row($sql2))
{
$recipients->addTo("$row2[0]");
}
$swift = new Swift($smtp);
$throttler->setEmailsPerMinute(100);
$swift->attachPlugin($throttler, "throttler");
$swift->batchSend($message, $recipients, new Swift_Address("xxx@xxx.com", "xxx"));
Thanks in advance.