Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to authenticate on SMTP server with username "[email protected]" using 3 possible authenticators

Tags:

When i run the code i got error "Failed to authenticate on SMTP server with username "[email protected]" using 3 possible authenticators. Authenticator CRAM-MD5 returned Expected response code 235 but got code "535", with message "535 5.7.0 Invalid login or password ". Authenticator LOGIN returned Expected response code 250 but got an empty response. Authenticator PLAIN returned Expected response code 250 but got an empty response."

config/mail.php

return [
    'driver' => env('MAIL_DRIVER', 'smtp'),
    'host' => env('MAIL_HOST', 'smtp.mailtrap.io'),
    'port' => env('MAIL_PORT', 2525),
    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
        'name' => env('MAIL_FROM_NAME', 'Hello'),
    ],

    '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'),
        ],
    ],

    'log_channel' => env('MAIL_LOG_CHANNEL'),
];

.env file is

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
[email protected]
MAIL_PASSWORD=****
MAIL_ENCRYPTION=tls
like image 462
Renu Avatar asked Apr 27 '19 13:04

Renu


2 Answers

do it like this in your env:

MAIL_DRIVER=sendmail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=***
MAIL_PASSWORD=***
MAIL_ENCRYPTION=tls
like image 165
Amirsadjad Avatar answered Sep 23 '22 23:09

Amirsadjad


Turn on Less secure app access

enter image description here

MAIL_MAILER=smtp

MAIL_HOST=smtp.gmail.com

MAIL_PORT=465

[email protected]

MAIL_PASSWORD=yourgmailpassword

MAIL_ENCRYPTION=ssl

[email protected]

like image 29
Abid Shah Avatar answered Sep 22 '22 23:09

Abid Shah