博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PHPMailer发送邮件,出现无法连接host (Could not connect to SMTP host)
阅读量:4202 次
发布时间:2019-05-26

本文共 373 字,大约阅读时间需要 1 分钟。

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

转载地址:http://kvcli.baihongyu.com/

你可能感兴趣的文章
set theme -yii2
查看>>
yii2 - 模块(modules)的view 映射到theme里面
查看>>
yii2 - controller
查看>>
yii2 - 增加actions
查看>>
网站加载代码
查看>>
php图像处理函数大全(缩放、剪裁、缩放、翻转、旋转、透明、锐化的实例总结)
查看>>
magento url中 uenc 一坨编码 base64
查看>>
强大的jQuery焦点图无缝滚动走马灯特效插件cxScroll
查看>>
Yii2.0 数据库查询
查看>>
yii2 db 操作
查看>>
mongodb group 有条件的过滤组合个数。
查看>>
yii2 用命令行操作web下的controller
查看>>
yii2 console的使用
查看>>
关于mongodb的 数组分组 array group
查看>>
MongoDB新的数据统计框架介绍
查看>>
mongodb fulltextsearch 关于语言的设置选项
查看>>
mongodb 增加全文检索索引
查看>>
symfony
查看>>
yourls 短连接 安装
查看>>
yii2 php namespace 引入第三方非namespace库文件时候,报错:Class not found 的解决
查看>>