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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.