>  기사  >  백엔드 개발  >  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으로 문의하세요.