Saturday, January 29, 2011

What's the best way to send bulk email?

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

  • 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.

  • 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.

    From warren
  • 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.

    mnml : You don't get blacklisted if you don't abuse and if you use SenderID and SPF records.
    Tim Howland : 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.
    mnml : 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.
    Tim Howland : 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.
    David Thornley : 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.
    Bart Silverstrim : 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 : 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.
  • 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. :)

    mnml : nice one thanks
    From Xorlev

0 comments:

Post a Comment