Jump to content

Sending BULK Emails


Canman2005

Recommended Posts

Hi all

 

I wondered if someone can give me some advice.

 

Basically I have this little newsletter system, I do a PHP QUERY to return all rows in a newsletter table and then run a PHP mail for each row returned.

 

I have started to get a few people signing up and recently I ran my script and my host moaned that I used lots of bandwidth and tied the server up, he suggested I get the script to send out 10 mails every 5 minutes to avoid this happening.

 

How could I get my script to just return 5 rows, wait 5 mins and then return another 5 rows and then repeat that again until no more rows are returned.

 

Can anyone give some good advice?

 

Thanks

 

Dave

Link to comment
Share on other sites

Well, if you have a script which sends mail already you can use header refresh to reload the script multiple times until the job is done, you can set the script to refresh every X amount of seconds. You will need to pass a variable to the script each time it refreshes to indicate where it left off in your mailing.

 

Then use that variable as the offset in your SQL query.

1'st script load send 5 emails - headers refresh in 60seconds passing the variable = 5

2'nd run, script offsets by 5 using the variable past and sends 5 more, headers refresh in 60 secs

etc...etc...

 

This is just some basic info that will hopefully get you started.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.