I want to sent mails from my laravel project with gmail smtp from localhost.
this is my .env file
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=myemail@gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
This is my config/mail.php file
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'myemail@gmail.com'),
'name' => env('MAIL_FROM_NAME', 'My Name'),
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('myemail@gmail.com'),
'password' => env('password'),
When I run the script, it gives me the following error:
ErrorException in StreamBuffer.php line 94:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Please note that I have already enabled the extension in my php.ini file.