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

  • A+
所属分类: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';
    }

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: