[FX.php List] Pegging the CPU with PHPMailer

Gjermund Gusland Thorsen ggt667 at gmail.com
Thu May 15 00:50:49 MDT 2008


Ehh, how about using heredoc?

ggt

2008/5/15 Jonathan Schwartz <jschwartz at exit445.com>:
> 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
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>


More information about the FX.php_List mailing list