PHPMailer發送郵件,出現無法連接host (Could not connect to SMTP host

西部世界
西部世界
管理员
352
文章
0
粉丝
PHP日常评论阅读模式
  • php   PHPMailer發送郵件,出現無法連接host,這是因為fsockopen函數被禁用,PHPmailer發送Email依賴此函數。

    修改:

    class.stmp.php

    解決:

    1:

    118行:

    $this->smtp_conn = fsockopen($host,    // the host of the server

    改為:

    $this->smtp_conn = pfsockopen($host,    // the host of the server

     

    2:

    文件:class.phpmailer.php

    291行:

    public function IsSMTP() {
    $this->Mailer = 'smtp';
    }

    改為:

    public function IsSMTP() {
    $this->Mailer = 'SMTP';
    }

文章末尾固定信息

 
西部世界
  • 本文由 西部世界 发表于2022年4月1日 16:38:51
  • 转载请务必保留本文链接:https://www.cnhawkit.com/1534.html
匿名

发表评论

匿名网友

拖动滑块以完成验证