Attempting to not blast an ISP all at once with lots of emails

My website sends several thousand emails out each day to my registered users. I’m finding that ISPs are becoming more strict on their rules and regulations for incoming email. Some of the bounced messages have an error stating that the ISP received too many emails at once from my mail server. In attempt to comply with their demands, I’m trying to think of a good way to adjust my cron job, which pulls emails from the mySQL database several times a day to send out the next batch of emails.

For you database experts, is there a way to structure my query so that the “sender” column, which contains the actual email address, will only send a few emails to a given ISP each time the query is run? Meaning, there might be 50 emails waiting to go out that are addressed to gmail.com users, and 30 emails waiting to go to yahoo.com users, but I would like to limit the results of my query so that five gmail.com users and five yahoo.com users are returned. I’m not really sure how to structure this, otherwise I would check out the mysql.com forum in an attempt to learn this on my own.

Thank you!

You could use a WHERE clause with LIMIT.

SELECT `emailAddress` from `myEmailList` WHERE `emailAddress` LIKE '%@gmail.com%' LIMIT 15

But then you have to also keep track of who an email has been sent to and who hasn’t. The best option might be to create a temporary table for all the addresses you need to send to, and simply delete the address from the table once you’ve sent an email to it.

Or, you could use a 3rd-party email service. They keep on top of sending limits and whitelists/blacklists so you don’t (typically) have to deal with that stuff.

I think that if you’re sending out “several thousand emails out each day” your ISP probably won’t care as much about the batch sizes as much as they will the volume.

Having a third part email service would not only save you worry, but you may find the “extras” they can provide (eg. open rates, A/B testing click throughs etc.) an added benefit.

I thought of a service like ConstantContact. However, the emails I generate and send out are generated on-the-fly using data from the database and are, therefore, very customized to each recipient. The email services you refer to are typically best suited for a “newsletter” type email, where each recipient is basically receiving the same content, right? Please correct me if you had something else in mind.

Thank you.

I don’t know how your “several thousand” emails are “very customized”, but for example, I get periodic emails from CVS (a convenience strore chain) that have my first name inserted into it and contains items of interest that pertain to stores in my geographic location. (eg. I live in New England so in addition to the expected Holiday stuff I also get Winter stuff that would be of no interest to those living in warmer areas).

I imagine the email services would have something like “tags” to allow you to modify a “template” to some extent.

There are two basic kinds of services available. The kind where you create and send newsletters all within the system (like constantcontact, mailchimp, aweber, etc), and the services that act just as an SMTP server (like sendgrid, mandrill, amazon SES, mailgun, etc) where you create the message and just use the service to send it out.

Could the contents of some of the emails get combined if you’re sending more then one to the same person in a given 24hr period? Typically how many emails is a single person being sent in a 24hr period?