Error sending mail: stream_socket_client()

Á

Álvaro Moura

Last updated on Jul 6, 2026

When you want to send an email and show this error:
 
stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed 
stream_socket_client(): Failed to enable crypto 
stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 [http://smtp.gmail.com:465] (Unknown error)

This problem occurs because the verification of the SSL certificate is unsuccessful, therefore, to solve this problem, you must follow these steps:

-Download the file carcert.pem and copy it to this example path: C:/Program Files/NetMake\v9\components\php\extras 

-Login to php.ini

-In the section [openssl] the parameter must be modified by: openssl.cafile= "C:\Program Files\NetMake\v9\components\php\extras\cacert.pem" 

-And then you must restart the apache: https://scriptcase-support.kayako.com/en-us/article/1321-restart-apache