Google SMTP 停止工作

Google SMTP Stopped Working

邮箱地址和密码绝对正确。该脚本一直运行到昨天。现在我们收到以下错误:

邮件程序错误:SMTP connect() 失败。

我们可以登录到 Google 电子邮件地址。我可以在 Outlook 中通过 SMTP 发送电子邮件。我们有 Google 个 Apps 免费版,因此无法联系 Google。

有人知道为什么连接刚刚停止工作吗?谢谢你。

  mail->SMTPDebug  = 2;
      $mail->IsSMTP(true); // enable SMTP
      $mail->SMTPDebug = 0;  // debugging: 1 = errors and messages, 2 = messages only
      $mail->SMTPAuth = true;  // authentication enabled
      $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
      $mail->Host = 'smtp.gmail.com';
      $mail->Port = 465;               // set the SMTP port for the GMAIL server
      $mail->Username   = $Username; // SMTP account username
      $mail->Password   = $Password;

      $doc_dir = 'pdf/';
      $mail->From = $From;
      $mail->FromName = $FromName;
      $mail->addAddress($email);

      $mail->WordWrap = 50; 
      $mail->addAttachment($doc_dir.$FileName);       
      $mail->isHTML(true);  
      $mail->Subject = 'Your '.$warehouse_name.' Order Has Shipped';
      $mail->Body    = $Message;
      $mail->AltBody = 'Racquet Depot UK';

      if(!$mail->send()) {

       echo 'Message could not be sent.';
              echo 'Mailer Error: ' . $mail->ErrorInfo;
         exit;
      };

主机设置了 SMTP 限制,导致了该问题。否则,代码是正确的。