Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My database contains 20,000+ verified email-addresses. These are user's emails with permission (users set in options) to receive newsletters, updates, etc... from website. I actually never used their email addresses for any purpose but now I want users to get some updates from website periodically (once per month or two months). My wonder is more about how to send same email to 20K of users as fast as possible and what restrictions I might face doing this?

I have some ideas how to do this using Cron and PHP build-in mail() function but I can't send 20K emails at once (may I?). Also, I know that emails will most probably end up in junk/trash/spam folder at receiver's (that's fine) but not sure is there some law against sending mass-emails or restrictions (defined by hosting service).

What I need is answer how I can do it and what's best way to accomplish this task? This is not "give me solution" question, just need some tips because I've never sent more than 5 emails at once in my life and couldn't find answer to this question. Wonder how large services, such as Facebook, Twitter, Youtube inform their users (probably millions of them at once)?

Note: Sorry if this is not right place to ask this question, I had second thoughts about where to post it, here or at StackOverflow, but according to how my problem looks like (I don't provide or ask for code), guess it would be closed at SO as "not constructive" or even "off topic".

share|improve this question

closed as not constructive by Ƭᴇcʜιᴇ007, TFM, 8088, Hennes, ChrisF Nov 10 '12 at 11:13

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

You can send 20 thousands emails at once using a quantum computer. –  ppumkin Nov 10 '12 at 0:03
If you don't know what you're doing, your best bet is to use a third party service. –  Michael Hampton Nov 10 '12 at 0:07
@MichaelHampton, you're right, I actually have no idea! But must start learning at some point. Course, I'm not going to use my user's emails for experiments and 3rd party service is probably better solution than one I can make by myself. –  Wh1T3h4Ck5 Nov 10 '12 at 0:14
Users might have agreed to receive newsletters from you, but not that you share their email addresses with a third party. –  Baarn Nov 10 '12 at 0:30
@Informaficker, course, they have checkbox in account-settings to agree/dissagree to receive emails from me (actually it's unchecked by default). I'm not going to send it to users w/ no permission. –  Wh1T3h4Ck5 Nov 10 '12 at 0:32

2 Answers 2

up vote 4 down vote accepted

You will face a few problems when sending all that email at once. or one by one.


In order to send that amount of email you need to setup SPF, possibly some sort of certificate signing, use a server with a static ip, preferably with reverse dns. When you start getting even larger you have to contact some email postmasters direct to get put on a white list by submitting legitimate reasons and paperwork. We used to send about 250thousand emails in a day, sometimes 4 times a month to our subscribers.

We wrote our own programme- but there are many available.

Also you can just loop each email and send it one bye one.. then try to hyper thread it .. eventually breaking down into domains and maybe you can send them all in about 1 hours with some clever programming.

Good luck

share|improve this answer
+1, that means, I can forget about easy solution :) –  Wh1T3h4Ck5 Nov 10 '12 at 0:10
Also remember, that some servers do grey-listing - they first refuse and wait for retransmission. If that happens, message is delivered (because many spam farms just ignore the protocol and do not re-send failed messages). –  peterph Nov 10 '12 at 0:10
@Wh1T3h4Ck5 - It is a bit more involved. You can use a cheap VPS with static IP. Just have to add SPF records and setup postfix(in linux) to allow connections from your PC at home to relay. Do not let anybody else use it - so use a very strong password. Many people had thier smtp hijacked and IP's blacklisted for backscatter, website hacks using localhost bypass, etc etc. It can be anightmare. –  ppumkin Nov 13 '12 at 9:13
@ppumkin Thanks for advice. Good to know that because this is unexplored area for me. –  Wh1T3h4Ck5 Nov 13 '12 at 17:42

Short answer: Do the static IP and reverse DNS. You can but don't send them in one hour. Mail servers don't like thousands of emails in a short while, you'll be blocked. I'd say even more if all that mail comes from a mail server that just popped in the net.

Long answer: I send 2.000 emails once a week. I use a program in php to send them, it's free software, I don't know if I can name it here so I won't. The web site is orange, it's in php to manage lists (newsletters). My server is a 1 GB ram xeon 2.4GHZ 4 cores with Debian, it sends 4 mails per second (around 100K each) with postfix (all outgoing mail is checked for viruses), so that should be 14.000 an hour. If you send too many emails to one domain, some of them might have some blocking feature. Yahoo had/has something like greylisting, I remember I had to contact them more than once for 3 months until they stopped the temporary rejects. My ISP rejects mails if it sees too many connections in a short while so in postfix I decremented the connections, I think from 20 to 10. By the way Gmail sends 5.000 mails per second, I heard it in a debconf (10,11,12) from one of the developers.

share|improve this answer
-1 You can send them in 1 hours. You just need to know how. 2thousand emails? That is a drop in the ocean pal! I jsut said we send 1 million emails a months without spam stopping us (4 x 250k) / (250k per 10 hours) do the math –  ppumkin Nov 10 '12 at 0:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.