I'd like to send an email with Swift Mailer and gmail smtp from my local server (Laragon on Windows 10).
First in my Gmail account :
- 2 step validation is disabled
- I turned on less security for applications
In my PHP file I create the swift transport like this :
// Create the Transport
$transport = (new Swift_SmtpTransport('smtp.gmail.com', 587, 'tls'))
->setUsername('*****@gmail.com')
->setPassword('******')
;
Then this error occurs I don't understand :
Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in F:\laragon\www\web-developer\PHP\PHP6-API\GmailAPI\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php on line 94
Any idea ? Must I activate something on the webserver for TLS ?