【问题标题】:Debugging SMTP email failures - GSuite调试 SMTP 电子邮件故障 - GSuite
【发布时间】:2017-11-08 15:20:59
【问题描述】:

我正在开发一个电子商务网站,当客户使用 G Suite SMTP 中继服务完成订单时,该网站会向他们发送大量电子邮件。但是这些电子邮件中有很多都失败了。它似乎也没有任何模式 - 有时所有电子邮件都会发送,有时只发送一两封,有时没有。

我收到以下错误:421, "4.7.0", Try again later, closing connection

看这里:https://support.google.com/a/answer/3726730?hl=en 并不能真正帮助我调试它或找出某些电子邮件失败的原因。

我正在使用 phpmailer 类 (https://sourceforge.net/projects/phpmailer/)

第一次握手失败时似乎会出现该问题:

function Hello($host="") {
    $this->error = null; # so no confusion is caused

    if(!$this->connected()) {
      $this->error = array(
            "error" => "Called Hello() without being connected");
      return false;
    }

    # if a hostname for the HELO was not specified determine
    # a suitable one to send
    if(empty($host)) {
      # we need to determine some sort of appopiate default
      # to send to the server
      $host = "localhost";
    }

    // Send extended hello first (RFC 2821)
    //If this fails then the second attempt will always fail
    if(!$this->SendHello("EHLO", $host))
    {
      //when this fails it generates the try again later error
      if(!$this->SendHello("HELO", $host))
          return false;
    }

    return true;
  }

那么调试这个的最佳方法是什么?

【问题讨论】:

  • 添加调试记录器和分步记录以确定确切的问题。

标签: php email smtp phpmailer google-workspace


【解决方案1】:

错误信息非常明确。您调用了第 3 方 Web 服务,该服务返回一个错误代码,表明您正在调用的服务器已满负荷,请稍后再试。这是一项允许您升级到付费计划的免费服务吗?通常当你看到他的那种东西时。

【讨论】:

  • 是的,我们使用的是 Google G Suite SMTP 中继服务,需要付费。我们每天最多可以发送 10k 封电子邮件,但我们离这个目标还差得很远,我很难想象 Google 的一台服务器会满负荷运行。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-12-18
  • 1970-01-01
  • 2016-03-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-23
相关资源
最近更新 更多