加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

升级到php 7后出现fsockopen错误

发布时间:2020-12-13 13:03:27 所属栏目:PHP教程 来源:网络整理
导读:我在数字海洋nginx和php 7上运行codeigniter3.03.当我尝试发送电子邮件时,我收到此错误: 码: Severity: Warning Message: fsockopen(): unable to connect to ssl://smtp.googlemail.com:465 (Connection timed out) Filename: libraries/Email.php Line N
我在数字海洋nginx和php 7上运行codeigniter3.03.当我尝试发送电子邮件时,我收到此错误:

码:

Severity: Warning
Message: fsockopen(): unable to connect to ssl://smtp.googlemail.com:465 (Connection timed out)
Filename: libraries/Email.php
Line Number: 1986

我的电子邮件设置是

$config['useragent'] = 'CodeIgniter';
$config['protocol'] = 'smtp';
//$config['mailpath'] = '/usr/sbin/sendmail';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_user'] = 'xxxxxx@gmail.com';
$config['smtp_pass'] = 'xxxxxxxxxxxx';
$config['smtp_port'] = 465; 
$config['smtp_timeout'] = 5;
$config['wordwrap'] = TRUE;
$config['wrapchars'] = 76;
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['validate'] = FALSE;
$config['priority'] = 3;
$config['crlf'] = "rn";
$config['newline'] = "rn";
$config['bcc_batch_mode'] = FALSE;
$config['bcc_batch_size'] = 200;

这个版本在php 5.x下的相同配置中运行完美.

在php.ini我有

extension=php_openssl.dll

启用.

我无法得到任何暗示,为什么这不应该在php7中工作.任何人都可以给我一个提示要检查的内容或这个错误的原因是什么.

你有没有试过smtp.googlemail.com?

另请注意另一个答案,一个工作示例(例如在超时定义中似乎有所不同):

> phpmailer send gmail smtp timeout

另一种方案:

> Having trouble with PHPMailer

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读