PHP Mass Email
Hello. My site has about 15k registered users and I want to send mass mail to all who were inactive for more than a week.
I know how to check if they were online for more than a week, but the problem is how I'm going to send 15k emails without the server to crash?
How I can do it smart without wasting too much resources for 15k emails (that some of them are fake)
I need it for one time (sent to all inactive members one time)
This may or may not help you:
A cron job would probably be the best option for you, run say once a day to check for users that had been inactive for 7 days.
On my site, which doesn't have so many users, I use the following to send mass mails to members where the mass mail is a custom message (through a form):
This obviously loops through the users table finding the criteria specified and therefore probably does use up a lot of resources....but at the moment I don't know of any other ways of doing it.
$body = mysql_escape_string($formValue['message']);
$subject = mysql_escape_string($formValue['subject']);
$from = 'firstname.lastname@example.org';
$Query = "SELECT * FROM userdetailstable";
$Result = mysql_query ($Query, $Link);
mail ($to, $subject, $body, $from);
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)