Gmail Sending Limits

The Duke Of Marshall שלום picture The Duke Of Marshall שלום · Aug 21, 2013 · Viewed 28.8k times · Source

I'm developing software on a website that uses PHPMailer to send mail through our company's Gmail accounts via SMTP. With the software, a customer signs up for the site and receives a receipt and a video ticket. Two separate emails per customer at sign up. Then, before the event starts we want to resend all the video tickets.

I was wondering what the limits were about sending emails. How many emails can we send per minute, per hour, per day via SMTP using PHPMailer?

Thanks.

UPDATE:

We are using Google Apps for business

Answer

Ok, I contacted Google directly to get the answer and here is their reply:

Thank you for your message.

I understand you have a query regarding the Google Apps for Business sending limits. As mentioned in our Help Center article at http://support.google.com/a/bin/answer.py?hl=en&answer=166852, the daily limitation is 2000 messages in a 24-hour period not day. In general, our servers can tolerate one message per second until sending limits are hit. We really don't have an hourly or minute limitation for sending. If you send messages too quickly you may get rate-limited but the account should not lock out.

By rate-limt, since in general one message per second, if you try to send too many messages per second you may get a message telling you that the message cannot be send or you must wait before sending a message.

So after their response we did a test of 1,000 emails. We would send an email out, wait for sent confirmation, wait 2 seconds, and then send the next one. This resulted in successfully sending out all 1,000 emails in about 55 minutes with a gap of 3-4 seconds between each email. Below is the code we used.

<?php

require("PHPMailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();

$mail->Host = "smtp.gmail.com";
$mail->SMTPAuth = true;
$mail->Username = 'USERNAME';
$mail->Password = 'PASSWORD';

$mail->From     = "[email protected]";
$mail->FromName = "Gmail Test";

$mail->AddAddress("[email protected]");

for($i=0; $i<=1000; $i++){
    $date = date("H:i:s m/d/Y");
    $mail->Subject  = "$date";

    $mail->Body = "Test $i of PHPMailer.";

    if(!$mail->Send()){
       echo "Error sending: " . $mail->ErrorInfo;
       break;
    }else{
       echo "$i. E-mail sent => $date<BR>";
       sleep(2);
       continue;
    }
}

?>