Php 调试SMTP电子邮件失败-GSuite
我在一个电子商务网站上工作,当客户使用G套件SMTP中继服务完成订单时,该网站会向客户发送大量电子邮件。但是这些邮件中有很多都失败了。它似乎也没有任何模式——有时所有的电子邮件都会发送,有时只有一两封,有时一封也没有 我收到以下错误:Php 调试SMTP电子邮件失败-GSuite,php,email,smtp,phpmailer,google-workspace,Php,Email,Smtp,Phpmailer,Google Workspace,我在一个电子商务网站上工作,当客户使用G套件SMTP中继服务完成订单时,该网站会向客户发送大量电子邮件。但是这些邮件中有很多都失败了。它似乎也没有任何模式——有时所有的电子邮件都会发送,有时只有一两封,有时一封也没有 我收到以下错误:421,“4.7.0”,请稍后再试,关闭连接 看看这里:这并不能真正帮助我调试这个或找出一些电子邮件失败的原因 我正在使用phpmailer类() 当第一次握手失败时,问题似乎会出现: function Hello($host="") { $this->
421,“4.7.0”,请稍后再试,关闭连接
看看这里:这并不能真正帮助我调试这个或找出一些电子邮件失败的原因
我正在使用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;
}
那么什么是调试这个的最佳方法呢?错误消息非常明确。您调用第三方web服务,该服务返回一个错误代码,表示您正在调用的服务器已满负荷,请稍后再试。这是一项免费服务,允许您升级到付费计划吗?通常你会看到他的这类东西。添加调试日志和步骤日志以确定确切的问题。是的,我们使用的是谷歌G套件SMTP中继服务,这是付费的。我们每天最多可以发送10万封电子邮件,而我们离这一点还差得远,我发现很难想象谷歌的一台服务器会有足够的容量。