The error message suggests that the authentication credentials provided are incorrect. Double-check that the email and password are correct. Additionally, ensure that the Google account has allowed access to less secure apps.
To enable access to less secure apps, follow these steps:
- Go to the Google account security page: https://myaccount.google.com/security
- Scroll down to the "Less secure app access" section and click on "Turn on access (not recommended)".
- Toggle the switch to enable access for less secure apps.
If the issue persists, try generating an app password for the Gmail account and use that instead of the account password.
To generate an app password, follow these steps:
- Go to the Google account security page: https://myaccount.google.com/security
- Scroll down to the "Signing in to Google" section and click on "App passwords".
- Select "Mail" and "Other (custom name)" from the dropdowns.
- Enter a custom name for the app password and click on "Generate".
- Copy the generated password and use it as the MAIL_PASSWORD in the .env file.
If the issue still persists, try using a different email service provider or contact Google support for further assistance.
Example .env file with app password:
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=generated_app_password
MAIL_ENCRYPTION=TLS
[email protected]
MAIL_FROM_NAME="${APP_NAME}"