Expected response code 250 but got code “535”, with message "535-5.7.8 Username and Password not accepted?

I'm trying to setup SMTP server of gmail in my laravel website but above issue, please help me find out the solution.

  • Total 1 Answer
  • 51
Can You answer this question?
Fond of IT

If you are getting the above issue while setting up google / gmail SMTP server. You need to follow below steps it will surely solve your problem. I had also faced this issue and following the below steps resolved my problem and mail getting started to come in my inbox.

1- You need to enable 2 step verification in your google account setting 
URL: https://www.google.com/landing/2step/

2- Now create App password which you will need to use in your website
URL: https://security.google.com/settings/security/apppasswords

3- Choose "Custom Name" and click to generate

4- Go to your laravel .env file and update below details:


MAIL_PASSWORD=password (Which you just generated it)

5- Now restart your apache server

These are the steps you need to go through and it will solve your problem without any headache.