【问题标题】:Google SMTP Stopped Working谷歌 SMTP 停止工作
【发布时间】:2015-09-22 15:43:22
【问题描述】:

电子邮件地址和密码绝对正确。该脚本一直工作到昨天。现在我们收到以下错误:

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

我们可以登录到 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;
      };

【问题讨论】:

标签: php email phpmailer


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2015-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-17
    • 2016-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多