If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Email List

Need a little help on an email list script.

I want to store email messages in a database, and then loop through any of those messages that haven't been sent to every single member listed in my members list. I'm on 1&1 and they only permit 55 emails sent every 5 minutes. So I have to do this with a Cron Job.

How would I make it so the script pulls one email message at a time, sends the email to each member in the members database, then marks the email as sent in the message database, and resets the "sent" column in the members database back to 0.

Maybe I should include the most recent message id sent for each members row?

How often do you have to email 'everyone' in the list? I'm just curious.
Once per day, once per week?

EDIT:
You also have the problem where if you have more than 55 people, you need to
know when ALL of them have received the email message. So it looks like you
might have multiple email messages to send. I'm assuming those email messages
need to be sent in order of how they appear?

Doing the limit of 55 will result in only 55 names, and you'll send out a message
to them ... but the next time it runs, you'll need to know which of the remaining
people didn't get the message, and WHICH message are you working on? It looks
like you could have like 10 messages in the queue waiting to be sent?

How many email addresses do you think you'll have now or in two years from now?
Will you have hundreds, thousands?

I think the answer to your problem will depend on how often email messages are
sent, and how many recipients you have.