Please help me wrap my head around a mailing list problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SawkenDotCom
Forum Newbie
Posts: 5
Joined: Tue Feb 22, 2005 1:22 pm

Please help me wrap my head around a mailing list problem

Post by SawkenDotCom »

I have a mailing list and I am trying to automate it. I am having some problems with it and I was hoping that someone with more experience could help me organize how I should solve my quandry (not write it, just guide me). Thanks.

My problem:
I have a mailing list of over 1200 accounts (every one has been opted in and any emails out have an automatic "opt out" function plus an email address of where to reach me) but my web host only allows sendouts of 200 emails every 20 minutes. I love the webhost to death and want to keep it. Is it possible to set up a PHP script that once an initial script was triggered (say the subject and body of an email), would then go on to trigger an email script every 20 minutes?

Thanks in advance.
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

This question seems like a variation of this viewtopic.php?t=30832.

You could put a LIMIT clause in your SQL statement and a cron job to kick it off at regular intervals.
SawkenDotCom
Forum Newbie
Posts: 5
Joined: Tue Feb 22, 2005 1:22 pm

Post by SawkenDotCom »

Thank you for the reply! I have looked into Cron jobs and it seems like they would be perfect, but can you trigger a cron job with a PHP script? These emails aren't sent out at any specific time.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you can set the cron to run a php script.. which the script doesn't have to do anything if there's nothing to send..
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

What I have done in the past is just have a recurring cron job that runs a PHP script to check a flag to see if it needs to do any work.

Another thing that I have done for the same reason that you have is that I have set up a private web page the uses setTimeout to refresh periodically. This makes it something that you can kick off manually and you can have the script spit out status info as it runs.
Post Reply