How do I improve the code/performance for php 4 version 3 compared to my OLD method of personalizing with a newsletter?
I just want to make sure I do this correctly. Is this type of code still allowed? (Note, I will use batchsend instead of 'send')
And I will gladly donate once this works, as I realize how much of a PITA it is to develop
Code: Select all
set_time_limit(0); ignore_user_abort();
flush(); ob_flush();
$sql="Select firstname,lastname,email,IP,joindate from pt_mailtemp";
$result=mysql_query($sql);
if (!$swift->hasFailed())
{
while($row=mysql_fetch_array($result))
{
$firstname=$row["firstname"];
$recipients=$row["email"];
$ip=$row["IP"];
$joindate=$row["joindate"];
$message=$_POST["message"];
$subject=$_POST["subject"];
$message=str_replace("[firstname]",$firstname,$message);
$subject=str_replace("[firstname]",$firstname,$subject);
$message=str_replace("[ip]",$ip,$message);
$message=str_replace("[joindate]",$joindate,$message);
$swift->send($recipients, '"John Smith<johnsmith@lblahblah.com>', $subject, $message);
}
$swift->close();