slushpuppie Posted June 23, 2009 Share Posted June 23, 2009 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 More sharing options...
joel24 Posted June 23, 2009 Share Posted June 23, 2009 use the mail function... its instant, other way is messy and more power intensive using database/cron jobs. Link to comment https://forums.phpfreaks.com/topic/163355-mail-question-regarding-batching/#findComment-861922 Share on other sites More sharing options...
PFMaBiSmAd Posted June 23, 2009 Share Posted June 23, 2009 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. Link to comment https://forums.phpfreaks.com/topic/163355-mail-question-regarding-batching/#findComment-861938 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.