私は、G Suite SMTPリレーサービスを使用して注文を完了したときに、多数の電子メールを顧客に送信する電子商取引サイトで作業しています。しかし、これらの電子メールの多数は失敗しています。それにはパターンはありません。すべてのメールが送信される場合もありますが、時には1つまたは2つのメールが送信されることもあります。SMTP電子メールの失敗をデバッグする - GSuite
次のエラーが表示されます:421, "4.7.0", Try again later, closing connection
。
ここをクリックしてください:https://support.google.com/a/answer/3726730?hl=enは、これをデバッグしたり、一部のメールが失敗する理由を把握するのに役立ちません。
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;
}
だから、これをデバッグするための最良の方法です:
私はphpmailerのクラスを使用しています(https://sourceforge.net/projects/phpmailer/)
問題は、最初のハンドシェイクが失敗したときに発生するようですか?
デバッグロガーとステップロギングを追加して、正確な問題を特定します。 –