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

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.