Good morning greetings to all, I have a problem with my gmail smtp and laravel to upload to production on your server, local using xampp works fine and sends me the mails but in production does not send anything but sends me the following error . What can this error be? do I need to configure something on the server?
Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 https://support.google.com/mail/?p=BadCredentials f66sm1199913qkc.25 - gsmtp
"
While on my local server does not throw any error and in gmail was already disabled the two-step verification that had been a problem to test on my local server and also enable Allow access for less secure applications: YES
Just set up the .env and the config / mail.php file and this way it works on localhost with my xampp
.env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=*****@gmail.com
MAIL_PASSWORD=*****
MAIL_ENCRYPTION=tls
config/mail.php
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', '*****@gmail.com'),
'name' => env('MAIL_FROM_NAME', 'MiNombre MiApellido'),
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];
Thank you very much, I hope you can help me.