I've configured to gmail SMTP server to send email. Account less secure app turned ON, also Recapture enabled. Here is the mail.php configuration.
This code working fine on local server. But when i tried to in godaddy server i saw the following Error :
(1/1) Swift_TransportException Failed to authenticate on SMTP server
with username "[email protected]" using 2 possible authenticators in AuthHandler.php (line 181)
.env (mail part)
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=xxxxxx
MAIL_ENCRYPTION=tls
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', '[email protected]'),
'name' => env('MAIL_FROM_NAME', 'xxxx'),
],
'encryption' => env('MAIL_ENCRYPTION', 'TLS'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
What should I do now?