samedi 5 août 2017

Laravel :Failed to authenticate on SMTP server with username using 2 possible authenticators

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 "xxxx@gmail.com" using 2 possible authenticators in AuthHandler.php (line 181)

.env (mail part)

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=xxxx@gmail.com
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', 'xxxx@gmail.com'),
    '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?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2uur0uI
via IFTTT

Aucun commentaire:

Enregistrer un commentaire