I have a problem with CakePHP 3.1 on my virtual server.
When I try to send e-mails on localhost, everything works perfect, no errors, no warnings.
However when I try to send e-mails on vserver, I receive the following error:
2016-01-06 11:07:33 Error: [Cake\Network\Exception\SocketException] stream_socket_client() [<a href='http://php.net/function.stream-socket-clien
t'>function.stream-socket-client</a>]: Peer certificate CN=`smtp.gmail.com' did not match expected CN=`ssl://smtp.gmail.com'
stream_socket_client() [<a href='http://php.net/function.stream-socket-client'>function.stream-socket-client</a>]: Failed to enable crypto
stream_socket_client() [<a href='http://php.net/function.stream-socket-client'>function.stream-socket-client</a>]: unable to connect to ssl://sm
tp.gmail.com:465 (Unknown error)
I have already tried to change the email configuration in app.php by adding the following:
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
],
This did not fix the problem.
Does anyone got a hint or solution for that problem?