Gmail Fsockopen(): Ssl Operation Failed Error with Codeigniter and Xampp

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.

  1. Generate an vbs file from this file.
    https://raw.githubusercontent.com/bagder/curl/master/lib/mk-ca-bundle.vbs
  2. Open a Command Prompt as Administrator and run

    C:>mk-ca-bundle.vbs

  3. After finish that process you need to modify the php.ini.

    openssl.cafile=C:\ca-bundle.crt

  4. 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



Leave a reply



Submit