Jump to content

mail() question - regarding batching


slushpuppie

Recommended Posts

i've recently coded a social networking site, which hopefully will catch on. right now there are very few users, around 100 total. i've got a messaging system, and a notification system, which alerts you when a friend adds you, when you're invited to something, etc... the client would like the user to be able to check a setting where they also get an email letting them know they have a new message or notification waiting for them on the site.

 

my question is whether i should have my application send an email when the message/notification is created, or perhaps should i insert a record into a database table and setup a cron job to query that table and mail all the emails out at once? any input as to why one method would be better than another? thanks so much.

Link to comment
https://forums.phpfreaks.com/topic/163355-mail-question-regarding-batching/
Share on other sites

Most web hosts have a limit on the number of emails that can be sent at one time and on the number that can be sent in a time period, so yes, creating a queue of some type of the emails you want to send and using a cron job/scheduled task to process that queue in a way that satisfies your web host's email limits would be the best general purpose solution.

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.