|
Posted by MonTassaR on 07/19/07 14:27
On Jul 18, 1:09 am, gordonb.h6...@burditt.org (Gordon Burditt) wrote:
> >I have to develop a script to be run nightly to go through a database
> >and send emails based on conditions. It's a large database, and there
> >are several thousands of emails to be sent during the week everyday.
> >The script will be run with a cron job at midnight or so.
>
> >I was wondering if PHP is suitable for this, or may it be problematic,
> >for instance would its execution abort after a certain amount of time?
> >Or is it perfectly fine for this task?
>
> You may want command-line PHP for this task. The interface is a
> little different (e.g. no $_GET and $_POST) but you can set different
> parameters and I believe the run time limit defaults to infinite.
> Anyway, the parameters can be put in a different .ini file and set
> differently than for web-based PHP.
I'd rather use set_time_limit() if php is not running in safe mode.
I just want to mention that if you plan to send a personalised content
for each contat, you may want to use an temporary table where, at the
begining of the mailing process you want to implement, you prepare
your data (associate mail adress and other contact stuff with suitable
content) using php, then launch an other script tha just grab data
from this temporary table and send it, this will considerably minimise
exectime and load on your server ..
Adding a sent/not_sent flag to this temp table would let you resume
sending mails if some things goes wrong with your smtp for example ..
[Back to original message]
|