问题描述
php.ini:extension = php_openssl.dll
- > uncommented
I已经尝试过: openssl.cafile = C:\xampp\perl\vendor\lib\Mozilla\CA\cacert.pem
我尝试过使用禁用的防火墙
我尝试过使用另一个网络
Codeigniter PHP代码:
$ config = Array(
'protocol'=>'smtp',
'smtp_host'=>'ssl://smtp.gmail.com',
'smtp_port'=> 465,
'smtp_user'=> '[email protected]',
'smtp_pass'=> 'asd',
'mailtype'=> 'html',
'charset'=> 'utf-8'
);
$ this-> load->库('email',$ config);
$ this-> email-> set_newline(\r\\\
); ('[email protected]','asd');
$ this-> email->
$ this->电子邮件 - >到($收件人);
$ this->电子邮件 - >主题($ a);
$ this->电子邮件>消息($ b);
$ this-> email-> send();
在我的情况下,Avast Antivirus阻止了端口。我使用SMTP端口 465 从我的CodeIgniter项目发送电子邮件。它显示了一个错误:
$ b
只需禁用Avast Antivirus即可解决问题。
可选解决方案
但是,如果您想保留您的Avast安全性,您应该: 打开Avast
清除您在重定向设置中使用的端口 MAIL 部分
关闭Avast
php.ini: extension=php_openssl.dll
-> uncommentedI have tried with: openssl.cafile= C:\xampp\perl\vendor\lib\Mozilla\CA\cacert.pem
I have tried with disabled firewallI have tried with another network
Codeigniter PHP Code:
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.gmail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'asd',
'mailtype' => 'html',
'charset' => 'utf-8'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]', 'asd');
$this->email->to($recipient);
$this->email->subject($a);
$this->email->message($b);
$this->email->send();
In my case, the Avast Antivirus was blocking the port. I was using the SMTP port 465 for sending an email from my CodeIgniter project. It showed an error:
Simply disabling the Avast Antivirus solved the problem.
Alternative Solution
But if you want to keep your Avast security on, you should:
Open Avast
Click on Settings (upper right corner of page)
Click on Troubleshooting
Click on Redirect Settings
Clear the port you used from Redirect Settings's MAIL section
Click OK
Close Avast
这篇关于GMail fsockopen():Codeigniter和XAMPP的SSL操作失败错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!