php Gmail 发送限制

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18361233/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 17:24:38  来源:igfitidea点击:

Gmail Sending Limits

phpgmailphpmailer

提问by The Duke Of Marshall ????

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.

我正在一个网站上开发软件,该网站使用 PHPMailer 通过我们公司的 Gmail 帐户通过 SMTP 发送邮件。使用该软件,客户注册该网站并收到收据和视频票。每位客户在注册时收到两封单独的电子邮件。然后,在活动开始之前,我们要重新发送所有视频门票。

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?

我想知道发送电子邮件的限制是什么。我们可以使用 PHPMailer 通过 SMTP 每分钟、每小时、每天发送多少封电子邮件?

Thanks.

谢谢。

UPDATE:

更新:

We are using Google Apps for business

我们正在使用 Google Apps for business

回答by The Duke Of Marshall ????

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.

感谢您的留言。

我了解到您对 Google Apps for Business 发送限制有疑问。正如我们在http://support.google.com/a/bin/answer.py?hl=zh-CN&answer=166852 上的帮助中心文章中所述,每天的限制是 24 小时内 2000 条消息,而不是一天。一般来说,我们的服务器每秒可以容忍一条消息,直到达到发送限制。我们真的没有每小时或每分钟的发送限制。如果您发送消息太快,您可能会受到速率限制,但帐户不应锁定。

通过速率限制,因为通常每秒一条消息,如果您尝试每秒发送太多消息,您可能会收到一条消息,告诉您该消息无法发送或您必须等待才能发送消息。

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.

因此,在他们回复后,我们对 1,000 封电子邮件进行了测试。我们会发送一封电子邮件,等待发送确认,等待 2 秒,然后发送下一封。这导致在大约 55 分钟内成功发送了所有 1,000 封电子邮件,每封电子邮件之间的间隔为 3-4 秒。下面是我们使用的代码。

<?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;
    }
}

?>

回答by Vishal Santharam

Gmail

Gmail



500 per day 20 emails / hour

每天 500 封 20 封电子邮件/小时



Google Apps

谷歌应用



Messages per day 2000

每天消息 2000



Messages auto-forwarded 10,000

消息自动转发 10,000



Auto-forward mail filters 20

自动转发邮件过滤器 20



Recipients per message 2000(500 external)

每条消息的收件人 2000(500 外部)



Total recipients per day 10,000

每天收件人总数 10,000



External recipients per day 3000

外部收件人每天 3000



Unique recipients per day 3000(2000 external)

每天唯一接收者 3000(2000 外部)



Recipients per message (sent via SMTP by POP or IMAP users) 99

每封邮件的收件人数(由 POP 或 IMAP 用户通过 SMTP 发送) 99



Refer 1

参考 1

Refer 2

参考 2