GMail fsockopen(): SSL operation failed error with Codeigniter and XAMPP
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:
fsockopen() failed to enable crypto
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
Codeigniter send email OpenSSL error
I have figured out the problem. I just turned off my antivirus (Avast).
SSL operation failed with code 1 whit smtp
I already solve this problem.
I realized that there is a lot of disinformation on the internet about this topic.
I hope this can be useful!
If you running PHP 5.3.7 or later.
- Generate an vbs file from this file.
https://raw.githubusercontent.com/bagder/curl/master/lib/mk-ca-bundle.vbs Open a Command Prompt as Administrator and run
C:>mk-ca-bundle.vbs
After finish that process you need to modify the php.ini.
openssl.cafile=C:\ca-bundle.crt
Restart the IIS web site and its all
in Codeigniter Unable to send email - fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused)
Connection refused means exactly that the connection to the peer was refused. This is because the server either does not expect connections at the port or because a firewall is blocking the connection. It is probably the last one in your case so check for firewalls which might block the access on the local machine but also in the network. It might also that a firewall in front of the server or the server itself is blocking access for example if your system is on some blacklist known for sending spam.
Related Topics
Php: Variable Not Working Inside of Function
How to Trim White Spaces of Array Values in PHP
Scaling a Chat App - Short Polling VS. Long Polling (Ajax, PHP)
Encrypt Files Using Pgp in PHP
Directory Index Forbidden by Options Directive
Getting Data with Utf-8 Charset from Mssql Server Using PHP Freetds Extension
Can You Append Strings to Variables in PHP
PHP Code to Test Pdo Is Available
Warning: MySQLi_Query(): Couldn't Fetch MySQLi
Calculate Skip Value for Given Record for Sorted Paging
Why Are Floating Point Numbers Printed So Differently
PHP - Get Key Name of Array Value
Having Problems While Try to Install Oauth with Pecl in Mamp on MAC Os Lion
Why Does Tcpdf Ignore My Inline CSS
Remove Index.PHP in Codeigniter 2.1.0