I can't seem to get this to work:
ENV:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=my_acc@gmail.com
MAIL_PASSWORD=***
MAIL_ENCRYPTION=tls
In controller:
Mail::send('mail.template', ['post' => $post, 'user' => $user], function($message) {
$message->to('my_acc@gmail.com', 'X Y')->subject('Comment');
});
And I get error:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
I have tried adding this to StreamBuffer.php
$options['ssl']['verify_peer'] = FALSE;
$options['ssl']['verify_peer_name'] = FALSE;
And then I get this error:
Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted.
And even if I didn't get that error, I would like a solution, not a quick fix...