SwiftMailer 发送邮件时 提示fsockopen() 被禁用
2016-03-15 12:22
429 查看
站点转移空间,发送邮件的SwiftMailer 类提示错误如下:
Warning: fsockopen() has been disabled for security reasons in D:\1\811963\html\lib\SwiftMailer\classes\Swift\Transport\StreamBuffer.php on line 233
233行的代码
if (!$this->_stream = fsockopen($host, $this->_params['port'], $errno, $errstr, $timeout))
phpinfo() 一看 原来是fsockopen被禁用 ,但是pfsockopen没被禁用,改成如下代码,发送邮件通过
if (!$this->_stream = pfsockopen($host, $this->_params['port'], $errno, $errstr, $timeout))
如果pfsockopen也被禁用,那就自己寻找可替代的函数吧!
Warning: fsockopen() has been disabled for security reasons in D:\1\811963\html\lib\SwiftMailer\classes\Swift\Transport\StreamBuffer.php on line 233
233行的代码
if (!$this->_stream = fsockopen($host, $this->_params['port'], $errno, $errstr, $timeout))
phpinfo() 一看 原来是fsockopen被禁用 ,但是pfsockopen没被禁用,改成如下代码,发送邮件通过
if (!$this->_stream = pfsockopen($host, $this->_params['port'], $errno, $errstr, $timeout))
如果pfsockopen也被禁用,那就自己寻找可替代的函数吧!
相关文章推荐
- Swift 数组,字典
- Swift 基本数据类型,常/变量声明(一)
- IOS开发系列之Swift_UI_Btn
- IOS开发系列之Swift_UI_Btn
- IOS开发系列之Swift_UI_Lab
- OC与Swift混编
- Swift-2.7闭包
- 《千万别说swift不用管理内存!这么多坑赶快记下》
- Swift的两个小窍门
- OC使用use_frameworks!添加swift,其他库头文件不提示
- swift 接水果游戏ios源码
- swift 接水果游戏ios源码
- swift系统学习第一章
- Swift基础3.3——便利构造函数
- Swift基础3.2——重载构造函数
- Swift基础3.1——构造函数
- Swift基础2.1——闭包
- Swift基础2.1——函数
- Swift基础1.5——基本语法——集合
- Swift基础1.4——基本语法——字符串