2

I have been using the sendmail function in PHP with Exim 4 so far when I had to send my mailing lists, I would like to know if there is a clean solution for that.

I'm quite sure that Facebook isn't sending email notifications in foreach loops.

I have tried to send them one by one using a Bash script doing a loop, but it's slow, and it's using database ressources.

I found a few mailing list managers on the Internet, I think it would be the best way to trac emails like

  • Phplist or
  • OemPro which isn't free but seems good

How to do this with the Zend framework? (Ref: "What's the best approach to sending email to hundreds of recipients from a Zend Framework application?")

swiftmailer

mnml
  • 327
  • 1
  • 7
  • 21
  • 6
    Unless this 100,000+ people actually knowingly signed up for this email, the answer is DON'T. – Paul Tomblin Sep 24 '09 at 11:29
  • 3
    If you have mailinglists that big and do not know how to professionaly handle mail, you are not qualified to do so anyways. – Sniek NL Sep 24 '09 at 11:45
  • 1
    voting to close, gave the reason as 'spam' - how very literal :) – Chopper3 Sep 24 '09 at 11:46
  • 2
    Likewise. Try as I might, I'm failing to see a reason how this kind of thing can be for any honourable purpose. – Maximus Minimus Sep 24 '09 at 11:50
  • 1
    Seems to be awfully vague as of the moment as to *why* he's sending so many messages and it's a very touchy subject...agree that it sounds suspiciously like a spammer. – Bart Silverstrim Sep 24 '09 at 11:53
  • 2
    Not so sure he is a true spammer. His site is a cable company... they could easily have 100,000+ users. – Scott Lundberg Sep 24 '09 at 12:09
  • 1
    either way, if no proper and professional mailing system is used, this is going to be spam – dyasny Sep 24 '09 at 12:13
  • Ironic that his first message was about spammers abusing his mail server, and now he's asking how to send out spam. – Paul Tomblin Sep 24 '09 at 12:13
  • It was an example. – mnml Sep 24 '09 at 12:29
  • 2
    not sure why this has been down-voted so far – warren Sep 24 '09 at 13:06
  • 1
    @warren, because anybody who thinks they should be sending 100,000 messages when they can't even tell the difference between receiving a spam with a forged reply-to and their mail server being hijacked is either a spammer or an idiot. – Paul Tomblin Sep 24 '09 at 13:16
  • 3
    Easy, guys. I agree with Scott Lundberg on this, it's not necessarily spam related. THAT SAID: @mnml, you should DEFINITELY edit this question to make your intentions crystal clear. Otherwise those who aren't already would be inclined to hop onto the spam bandwagon as well. The fact that you've accepted an answer with legitimate options implies this is legit. – squillman Sep 24 '09 at 13:51
  • Let's close this. apparently I'm a spammer and an Idiot just because I'm asking how to send some email without using ugly foreach loops and php mail functions. – mnml Sep 24 '09 at 13:55
  • 3
    @mnml: No, it's just that you're treading in dangerous water on that topic and the wording of the question can be interpreted in a good way or in a not-so-good way. If you add some wording to mention what it is that you're trying to accomplish, that ambiguity could be eliminated. Explain that you have a legitimate business need to send out mass mailing. – squillman Sep 24 '09 at 14:19
  • 2
    @mnml; don't take it personally. This is a hot-button topic and there are some folks that have itchy trigger fingers. =) Take squillman's advice and I'm sure you'll get some good responses. I'd help out if I could, but this is a topic that I'm not familiar with. – Wesley Sep 24 '09 at 14:52
  • 4
    I don't see a problem with the question, either. Bulk e-mail is not always spam. – Ed Leighton-Dick Sep 24 '09 at 17:00
  • 1
    Can this please be reopened, seeing as how the question has been updated, and obviously there are valid reasons for wanting/needing to send a bunch of email? – warren Sep 25 '09 at 06:15
  • 1
    The entire problem was that as it was originally worded, you had a guy pop in asking how to send 100,000 emails to people. No clarification as to WHY. THE MOST COMMON REASON is filling my spam filter right now. Rather than saying that you're working in a cable company and need a way to email notifications to customers, the question was left vague and open to interpretation. Considering that most sysadmins spend SIGNIFICANT time FIGHTING SPAM, what do you THINK people are going to do? – Bart Silverstrim Sep 26 '09 at 11:56
  • 1
    see also http://serverfault.com/questions/67154/sending-an-email-to-about-10k-users-not-spam – warren Oct 09 '09 at 11:46

4 Answers4

7

For these kinds of mail loads you really have three options, and only one of them makes sense:

1) write your own application. For mailing lists that I've managed (optin marketing lists and newsletters for ecommerce sites and loyalty programs), I've handled loads of 200K - 1M emails using the perl Mail::Bulkmail package as the core of a relatively simple app.

2) Use a mailing list manager like listserv or mailman to handle the email and the unsubscribes. This works well if you can learn the package thoroughly.

3) Use a service that handles it for you. Lyris is good, campaignmail, etc- there are many reputable providers.

Frankly, you want to use an outside service. Negotiating mail whitelist status with the major providers is an ENORMOUS pain in the ass. These services have done it for you, and there's enough competition that the prices are pretty damn reasonable if you shop around. In addition, they'll prevent the marketing jackasses at your company from sending spam- the reputable providers are very strict about the email sources, as they don't want to risk getting blacklisted as spammers.

Tim Howland
  • 4,678
  • 2
  • 26
  • 21
1

You can tell php to foreach over the list and not timeout by changing the timeout for the particular script. Another alternative, would be to create aliases that send to the whole shooting match at once.

However, you should be either using a "real" management tool like mailman, or outsourcing this, in my opinion.

warren
  • 17,829
  • 23
  • 82
  • 134
1

Bear in mind that the technical aspects aren't the only thing to deal with in large mailing lists. If you're sending out large quantities of email that people will perceive as spam, you'll get complaints, and maybe blacklisted. (That's one reason botnets are popular among spammers nowadays - no one node will be obviously spamming.)

I'd suggest finding a reputable emailing service, because frankly it looks to me like you need more help with this than you're going to get online.

David Thornley
  • 181
  • 1
  • 1
  • 4
  • You don't get blacklisted if you don't abuse and if you use SenderID and SPF records. – mnml Sep 24 '09 at 15:36
  • Actually, you can get blacklisted by the big players (yahoo, gmail, etc) if a certain number of folks report you as spam to their ISP and you aren't whitelisted. Unfortunately, with most newsletters, lots of folks forget they subscribed and simply hit the "mark as spam" button- leading to you getting misclassified. – Tim Howland Sep 24 '09 at 16:15
  • I don't think you get completely blacklisted when you are reported as spam on gmail. It's just blacklisting the mail reported as spam, not the sender. – mnml Sep 25 '09 at 09:53
  • Unfortunately, in the case of AOL, you're dead wrong. My direct personal experience as well as conversations with their postmasters when I was setting up whitelisting contradict you. – Tim Howland Sep 25 '09 at 12:41
  • There is no standard Internet blacklist, although there are some popular ones. Therefore, there is no standard way to avoid being classed as a spammer, and no standard way to find out if you are being so classed somewhere. I really think, mnml, that you are in over your head here, and once more I recommend finding a reputable service or at least learning a lot more about Internet culture and email. – David Thornley Sep 25 '09 at 13:41
  • admins blacklist on whatever the @#% they want. We're a school and have been on blacklists when we didn't SEND any email. Someone apparently blocked an IP range we were within. Tell yourself what you want, but there's ALWAYS a chance someone will be fed up enough with spammers that they'll just wipe your server off their incoming allows if they're in a bad mood and it won't significantly impact most of their users. – Bart Silverstrim Sep 26 '09 at 11:58
  • 1
    Oh, and sometimes they'll blacklist just because they test your mail server and see that it *may* be a relay, according to their tests. Had that happen in the past as well. – Bart Silverstrim Sep 26 '09 at 11:59
1

Personally, just as a PHP-level solution, I used PEAR Mail::Queue. This way I can process bulk email as needed. I run a site where a single user action can spawn hundreds of email notifications and would create noticeable lag to send them at creation time. A cron job sends them as needed, scaling to fit demand within limits. It works well for my needs, perhaps it can work for yours. :)

Xorlev
  • 1,845
  • 14
  • 12