If you try to send emails to more than 500 recipient using Gmail SMTP you'll get "550 5.4.5 Daily sending quota exceeded".

Gmail smtp can be life-saving to people who use shared hosting (or not-so-clean IP) and usually suffer from spam-delivery or silent-drop from other email providers.

Can we do anything about this? May be something like followings.

Create N numbers of sender account (i.e. noreply01@example.com to noreplyN@example.com), register all of them for "Send As" your site email address (i.e. webmaster@example.com).

Option 1: Time slicing

$index = intval(hour_of_day / 24 * (N + 1));
$sender = sprintf("noreply%02d@example.com", $index);

This will effectively increase the sending limit to 500 emails every 24/N hours ;

Option 2: State machine

// store $index in DB
// store $emailCount in DB
if (emailCount > 480) {
    $index = ($index + 1) % N + 1;
}
$sender = sprintf("noreply%02d@example.com", $index);

This will nicely accommodate peak time load as long as we are below daily limit of N * 500.

Option 3: Reliable queue (DB)

Failed delivery can be dumped into reliable queue (DB) which will be executed by cron latter. Any non-time-sensitive material should always be pushed to reliable queue (DB) with lower priority and they will be subjected to throttling at lower sending rate (say 40% of full capacity).

Let me know if these options make you say WOW :-)

Never the less, this is totally legal as per Gmail TOS. In fact they suggest this workaround in their FAQ if standard sending limit is not workable for someone.

Cheers,
Sudhaker
http://sudhaker.com

Comments

benwalton’s picture

Do you have a link to where in the Google FAQ it mentions this?

skizzo’s picture

webgeer’s picture

I think the Queing could be done by another module. There is a module that is designed to do this: MailQ.

cozzi’s picture

What was the final outcome of this?

I've been searching and searching looking for how to control/limit the maximum number of outbound emails that are sent in a 1 hour window and I can't find anyone that's post a completed solution? Given that every host I know has some number as their sending limit per hour, what are people doing?

This round robin approach with Drupal sounded promising but I don't see where the code actually goes or if anyone has tried it.

Any suggestions?

Thank you
Cozzi

ferrangil’s picture

Subscribing...

kriskd’s picture

Subscribing as well.

Given that every host I know has some number as their sending limit per hour, what are people doing?

My hosts limited e-mails to 100 per hour. I ran into this on a site I just coded in PHP where I use the mail function in several different places. However, I have a Drupal site where I use the notify module and as far as I know, I have not had this issue. According to this discussion people have run into it so Drupal must not have a work-a-round which was my question.

bryancasler’s picture

Google Apps Daily Email Limit

VIA: http://www.google.com/support/forum/p/Google+Apps/thread?tid=2208d7a55a9...

Premier accounts can send up to 2000 per day.
*I'm guessing applies to Non-Profit and Education Accounts as well

Regular accounts can send up to 500 per day.

imjpark’s picture

Bluehost has a 750 per hour limit. Bluehost.com

Here’s a comparison of different hosting’s email daily sending limit.

http://www.bigdealsonweb.com/2009/09/hostings-maximum-daily-hourly-email...

akalata’s picture

Status: Active » Closed (won't fix)