I need a good/fast way to mail this many users.
Currently i have code something like this
$headers = "From: MehSite.Com <my email>\n\r";
loop trhough users in DB
mail($email, $subject, $message, $headers);
end loop
this just takes to long. to even mail 30,000 users it takes like 3hours or so. lols.
Mass email 1,000 - 1,000,000 users?
Moderator: General Moderators
-
psychotomus
- Forum Contributor
- Posts: 487
- Joined: Fri Jul 11, 2003 1:59 am
Re: Mass email 1,000 - 1,000,000 users?
Your problem is not a code efficiency problem.
If you want to make it run faster, buy a faster computer.
If you want to make it run faster, buy a faster computer.
Re: Mass email 1,000 - 1,000,000 users?
Don't encourage the spammers. lol
Re: Mass email 1,000 - 1,000,000 users?
your code is perfectly fine. I don't think of any other way. upgradeing your server might help.
what's your server configuration? is that a dedicated or shared server?
what's your server configuration? is that a dedicated or shared server?
-
SpartanDonut
- Forum Newbie
- Posts: 1
- Joined: Mon Oct 26, 2009 10:55 am
Re: Mass email 1,000 - 1,000,000 users?
Another thing to look into possibly is how optimized your database / query is. There might be a more efficient way to grab the email addresses than what you are doing.
Re: Mass email 1,000 - 1,000,000 users?
Using the mail() function directly will not scale with a large volume of Emails. Read the second note in the manual - http://php.net/manual/en/function.mail.php:
In addition to the packages they mention there, you can also try Zend_Mail and swiftmailer.Note: It is worth noting that the mail() function is not suitable for larger volumes of email in a loop. This function opens and closes an SMTP socket for each email, which is not very efficient.
For the sending of large amounts of email, see the » PEAR::Mail, and » PEAR::Mail_Queue packages.
Re: Mass email 1,000 - 1,000,000 users?
Evil! Evil I tell you!