Anti-Moronic Posted February 1, 2010 Share Posted February 1, 2010 Just wondering, I am going to be sending lots of notification emails and want to know what you think is the best way to approach this. Let's say I have 200 people subscribed to a comments section. I need each one of those 200 people notified when a new comment is posted. Or maybe 200 people are following a profile and each time they make a post, those 200 people must be notified. What is the best way to do this and do I require a ton of server resources? I was thinking to send out the notifications by trigger. So when the person posts or a new comment is posted, then it would loop through. But then I realized, this would be unnecessary. So should I use a cron job or otherwise? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/190574-advice-on-sending-lots-of-notification-emails/ Share on other sites More sharing options...
RussellReal Posted February 1, 2010 Share Posted February 1, 2010 cronjob isn't instant notification. if you want to send alot of emails constantly, you're going to want to use the PEAR MAIL package. Quote Link to comment https://forums.phpfreaks.com/topic/190574-advice-on-sending-lots-of-notification-emails/#findComment-1005124 Share on other sites More sharing options...
Anti-Moronic Posted February 1, 2010 Author Share Posted February 1, 2010 I know cronjob isn't instant. I'd have one set every 6 hours or something to send unsent notifications. My next problem though is sending over 500 emails in one go. I'm still on shared hosting. Does PEAR MAIL offer throttling so I can limit the amount of emails send an hour? Quote Link to comment https://forums.phpfreaks.com/topic/190574-advice-on-sending-lots-of-notification-emails/#findComment-1005139 Share on other sites More sharing options...
RussellReal Posted February 1, 2010 Share Posted February 1, 2010 create a queue file or queue database..and every hour send 100 emails or w.e. The whole idea of sending emails to ever commenter is pointless in my opinion, and will actually deter users from posting comments, because nobody likes a million emails from a website.. I know I don't. Quote Link to comment https://forums.phpfreaks.com/topic/190574-advice-on-sending-lots-of-notification-emails/#findComment-1005184 Share on other sites More sharing options...
Anti-Moronic Posted February 1, 2010 Author Share Posted February 1, 2010 Hi, sorry I should clarify. I wouldn't be sending emails to people who didn't request them. This is for people who 'subscribe' to the comments or a user who posts articles. Do you have any links which can explain how I set up a queue database on lamp? Thanks for your help. Appreciate it. Quote Link to comment https://forums.phpfreaks.com/topic/190574-advice-on-sending-lots-of-notification-emails/#findComment-1005191 Share on other sites More sharing options...
RussellReal Posted February 1, 2010 Share Posted February 1, 2010 just set up a db table.. and input emails you're going to send.. and then when it comes time to send emails.. send out 100 emails to 100 results, then remove those results from the database table. Quote Link to comment https://forums.phpfreaks.com/topic/190574-advice-on-sending-lots-of-notification-emails/#findComment-1005203 Share on other sites More sharing options...
Anti-Moronic Posted February 1, 2010 Author Share Posted February 1, 2010 Hey RussellReal, thank you so much! You lead me onto mail queue for pear. Wow, that's very powerful. I'm going to integrate that with my website and see how it goes. First time I've used pear mail too and I'm very impressed. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/190574-advice-on-sending-lots-of-notification-emails/#findComment-1005230 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.