Laravel Gmail Not Working, "Username and Password Not Accepted. Learn More..."

535-5.7.8 Username and Password not accepted when sending mail

try this:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=taibarani780@gmail.com
MAIL_PASSWORD=""
MAIL_ENCRYPTION=tls

Make sure that your password is rounded by the double quotes "".

Nodemailer: response: '535-5.7.8 Username and Password not accepted

Solved it by creating App password inside Google account. You must have 2-step verification actived.

2-step actived

App password created

Laravel Gmail: 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

Just change your 'driver' => 'smtp', to 'driver' => 'sendmail' in env file.
Make sure allow less secure apps is ON in your google account settings.

Laravel not working sending emails with gmail

The error message you posted indicates that:

  1. Your attempt to send an email is being received successfully and correctly by Google.
  2. Google believes that the credentials you supplied are unacceptable, for whatever reason.

Following the URL in the error message, Google has some tips:

If you’re sure your password is right, try these tips:

  • If you've turned on 2-Step Verification for your account, you might need to enter an App password instead of your regular password.
  • Visit http://www.google.com/accounts/DisplayUnlockCaptcha and sign in with your Gmail username and password. If asked, enter the letters in the distorted picture.
  • Your app might not support the latest security standards. Try changing a few settings to allow less secure apps access to your account.
  • Change your password according to our tips on creating a strong password.

In particular, 2-Step interference or the captcha might be good places to start figuring out why Google is unhappy. Nobody likes an unhappy Google.



Related Topics



Leave a reply



Submit