I am trying to send mail in laravel5.5 using simple mail method, below is the code which i am trying to call in controller for mail function:-
Mail::send('emails.special_orders', ['key' => 'value'], function($message)
{
$message->to('infinity@gmail.com', 'John Smith')->subject('Welcome!');
});
After this, i have also put the details in .env file i.e.:-
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=infinity@gmail.com
MAIL_PASSWORD=12345
MAIL_ENCRYPTION=tls
Even in config/mail.php file i have written:-
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'infinity@gmail.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
When I am trying to send mail, I am receiving an error, like:-
{
"message": "stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed",
"exception": "ErrorException",
"file": "C:\\xampp\\htdocs\\salon\\vendor\\swiftmailer\\swiftmailer\\lib\\classes\\Swift\\Transport\\StreamBuffer.php",
"line": 94,
"trace": [
{
"function": "handleError",
"class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions",
"type": "->"
},
What could be the reason?