PHP, ZendMail, xenForo | stream_socket_client(): SSL operation failed with code 1

I’m using xenForo on PHP7.0 with apache2 and Let’s Encript and have problems sending mails with SMTP.

For a specific error message I created this script:

<?php

ini_set('display_errors', true);
var_dump(stream_socket_client('ssl://DOMAIN_TO_MAILSERVER:465'));

and I’m reciving this error:

Warning: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:0A000086:SSL routines::certificate verify failed in /var/www/html/testscript.php on line 4

Warning: stream_socket_client(): Failed to enable crypto in /var/www/html/testscript.php on line 4

Warning: stream_socket_client(): unable to connect to ssl://DOMAIN_TO_MAILSERVER:465 (Unknown error) in /var/www/html/testscript.php on line 4
bool(false)

After now searching for a couple days I found out, that this is a ssl problem. According to other solutions I downloaded a cacert.pem file and included it to my php.ini, but this does not solve the error.

Setting verify_peer_name and verify_peer to false is not an option.
Login credentials are correct, testest with SMTP Tester online.

Hope anyone can help.