I'm trying to send an email from localhost with Laravel 5.2 (using PHP 7.0.8 and XAMPP), but I get this error:
Swift_TransportException in StreamBuffer.php line 269:
Connection could not be established with host smtp.gmail.com [ #0]
The values of my loaded mail config looks like this (using Config::get("mail")):
"driver" => "smtp"
"host" => "smtp.gmail.com"
"port" => "465"
"from" => array:2 [
"address" => "***@gmail.com"
"name" => "MY_NAME"
]
"encryption" => "ssl"
"username" => "***@gmail.com"
"password" => "***"
"sendmail" => "C:\xampp\sendmail\sendmail.exe -bs"
I've googled the last few days around 10 hours, but did not find a solution which is working. I've also tried to change "port" => "587"
and "encryption" => "tls"
, but this did not work either. The error is:
ErrorException in StreamBuffer.php line 95:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
In my Google Account I've already allowed "less secure apps". Is there anything I can try?
btw: with the PHP mail function it is possible to send emails using my gmail account.