Hi
I'm building a 'job posting' site of sorts.
When a job is available in a particular state, I want the system to send an
email to everyone who is 'watching' that state.
I know how to do this, but I need to figure out a way to 'send the emails
in the background' - ie: if an administrator adds a job to Wyoming, I don't
want them to have to wait for the php script to finish selecting and e-
mailing everyone watching the state before the administrator can move on
and do other things.
I originally thought that passing this task to the PHP command line would
do the trick, but it turns out that a script like...
exec("my php script that emails people");
echo "complete!";
....does not echo "complete!" until the thousands of people have all had
their info passed to the mail server (a long time).
I suppose that I could get rid of this by just lumping everyone together in
the Bcc: field of a single e-mail message, but at this point I'd like to
keep that as a last resort and go with the personalization ("Hi James... a
job has been posted in Wyoming").
Does anyone have any thoughts as to how I can send the emails without
preventing the administrator from doing other tasks until the script has
finished executing?