首頁  >  文章  >  後端開發  >  PHPMailer发送邮件,出现无法连接host (Could not connect to SMTP host)_PHP教程

PHPMailer发送邮件,出现无法连接host (Could not connect to SMTP host)_PHP教程

WBOY
WBOY原創
2016-07-15 13:21:251074瀏覽

 


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';
  }


 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/477185.htmlTechArticlephp PHPMailer发送邮件,出现无法连接host,这是因为fsockopen函数被禁用,PHPmailer发送Email依赖此函数。 修改: class.stmp.php 解决: 1: 118行:...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn