[FX.php List] Pegging the CPU with PHPMailer

Jonathan Schwartz jschwartz at exit445.com
Wed May 14 18:49:38 MDT 2008


Hi Folks,

I'm looking for some advice on being more efficient with my new mass 
mail script using PHPMailer.

The problem is that I am pegging the CPU during the send.

My first idea is that I am doing "mail merge" badly. I'm doing it 
live, replacing homemade variables during the send. I'm using 
Str_replace to insert the values into the html lettter:


$newhtmlstring =str_replace("{name}",$findData['name'][0], $htmlstring);
$newhtmlstring= str_replace("{email}",$findData['email'][0], $newhtmlstring);
$newhtmlstring= str_replace("{MID}",$findData['MailID'][0], $newhtmlstring);
$newhtmlstring= str_replace("{folder}",$findData['data5'][0], $newhtmlstring);
$newhtmlstring= str_replace("{data1}",$findData['data1'][0], $newhtmlstring);
$newhtmlstring= str_replace("{data2}",$findData['data2'][0], $newhtmlstring);
$newhtmlstring= str_replace("{data3}",$findData['data3'][0], $newhtmlstring);

The html field contains the home made {fieldname} entries.

How bad of a technique is this?  The html field is about 5k.

Thx

jonathan
-- 
Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
http://www.exit445.com
415-381-1852


More information about the FX.php_List mailing list