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
https://forums.phpfreaks.com/topic/130328-sending-bulk-emails/
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
https://forums.phpfreaks.com/topic/130328-sending-bulk-emails/#findComment-676041
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.