Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This has been asked and answered many times before:

http://searchyc.com/sending+mail

But, I'll answer anyway...

I wrote a script in Perl to query our db and send out messages to every active account (those that have verified addresses). Took about ten minutes, including testing on a small dummy data set. Since the task is so trivial, I've written similar scripts (in many languages...bash, Python, PHP, and probably others) dozens of times in the past ten years.

Protip: Use a properly configured actual mail server (Postfix, Sendmail, exim, etc.), and use your script to inject into the queue (using library bindings or simply the 'sendmail' command or equivalent). Many standalone SMTP libs are crap, and will lead directly to the bitbucket. Strict RFC compliance is more important with mail than any other protocol.

Also, don't sort by destination domain. Many mail providers will filter or rate limit (or worse) your deliveries if you send many messages all at once. This was once the Right Way to deliver, since there are optimized methods of sending many messages to the same SMTP host, but spammers have killed that enhancement. You may also want to sleep for a second or two between each message or batch of messages, for the same reason. Our list of 5000, or so, users took a few hours to send...but most of them made it to their destination, and very few bounced (almost entirely just those that were actually invalid email addresses).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: