'Unable to connect to mail server from PHP on windows 10

I am trying to configure my localhost Laravel project to be able to send an email, however, I am getting:

[2022-05-04 22:59:20] local.DEBUG: An error occurred while trying to create a user: [email protected] Swift_TransportException: Connection could not be established with host smtp.zoho.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in C:\workspace\project\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php:261
Stack trace:
#0 [internal function]: Swift_Transport_StreamBuffer->{closure}()

PHP version is as below;

php -v
PHP 8.1.5 (cli) (built: Apr 12 2022 17:38:57) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.5, Copyright (c) Zend Technologies
    with Xdebug v3.1.4, Copyright (c) 2002-2022, by Derick Rethans

**Note:

My time on the machine is correct!**

MAIL_MAILER=smtp
MAIL_HOST=mail.server.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=password
MAIL_ENCRYPTION=SSL
[email protected]
MAIL_FROM_NAME="${APP_NAME}"


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source