DevTaabi
DevTaabi

Reputation: 77

535-5.7.8 Username and Password not accepted when sending mail

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 z7sm6546905pgb.24 - gsmt

This error occurs when I try to send email

    QUEUE_DRIVER=database
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls

Upvotes: 0

Views: 8714

Answers (2)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117206

Solution post May 2022:

If you are seeing this issue after May 2022, The issue you are having is related to googles remove Less secure apps & your Google Account setting from our google accounts. Less secure apps was what enabled us to use our google login and passwords with their smtp server.

In order to use it now you must enable 2fa on your google account and configure an apps password. You can then use the apps password in place of your actual google password to connect to the smtp server.

Quick fix for SMTP username and password not accepted error

Upvotes: 0

BabaBaluchi
BabaBaluchi

Reputation: 68

try this:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=""
MAIL_ENCRYPTION=tls

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

Upvotes: 1

Related Questions