Hi, This is for an article site, where people can submit articles. What I want to do is to send emails to all users when any user submits a new article. I can run a loop with a mail function in it, and this is ok with 10-50 users, but what if the site has 1000 users registered? How do I send an email to all these 1000 users when any 1 member submits an article? Any tips are useful. I'm completely blank here. Thanks
Do you have rss feeds for ur site.. if so what you could do is register at feedburner and use the email subscribtion option
i suggest you to make a cronjob which runs about every 2-3 minutes and sends out around 50 mails every time. in this case every mail will be sent out without problem
Use effective loop with timer. Thank U ====================================================== www.seowebindia.com - Web solutions @ cheap rate.
You could use your loop with a sleep() function to send your mail to your 1000 user. You have to use sleep function to pause in a second or two to avoid banned your domain from many email services they will though you are a spammer...lol setup a cronjob to execute your loop every 5 minutes. cheers
Hi, Going with a cron job, but here's another problem. In the table where I am storing member info, I added a field "lastID" which stores the id of the article which was last emailed to them. Suppose it's 2000 When a new article was submitted, the new id for article will be 2001 which is different from 2000 in member's lastID. Cron now starts sending email every 5 minutes (sets lastit to 2001). Another article gets submitted in next 3 minutes (2002) Now the people who are already sent an email will get another email (different article of course), while people who did not get an email for 2001 will never get it because latest one is 2002. What to do here? Instead of sending email per article, should I make a list of all articles submitted in 1 day, and set the cron to send this huge list to all members? I really wanted to send email per article though... Any ideas? Thanks I am thinking of using sleep, but that will make the script slower and slower as new members register. Totally confused. Thanks