7

Few days ago gmail change is policy regarding the option "Less secure apps & your Google Account" This setting is no longer available

My Laravel app is stopped sending email

MAIL_MAILER=smtp
#MAIL_HOST=smtp.gmail.com
#MAIL_PORT=465
#MAIL_USERNAME=test@gmail.com
#MAIL_PASSWORD= *********
#MAIL_ENCRYPTION= ssl
#MAIL_FROM_ADDRESS=test@gmail.com
#MAIL_FROM_NAME=""`

Please help

N69S
  • 16,110
  • 3
  • 22
  • 36
Adnan Zaheer
  • 392
  • 3
  • 13

3 Answers3

12

yes, It's not working after removing the option by google. But nothing to worry! It's still very simple to send email. To send email again you need to do this as bellow:

  1. Login to your gmail account e.g. myaccount.google.com afaik
  2. Go to Security setting and Enable 2 factor (step) authentication
  3. After enabling this you can see app passwords option. Click here!
  4. And then, from Your app passwords tab select Other option and put your app name and click GENERATE button to get new app password.
  5. Finally copy the 16 digit of password and click done. Now use this password instead of email password to send mail via your app.

Now you can use just email and this generated pass to send email.

from https://stackoverflow.com/a/72626684/533426

Toskan
  • 13,911
  • 14
  • 95
  • 185
5

Less secure apps (https://myaccount.google.com/u/0/lesssecureapps) option has been disabled by google.

We need to use apppasswords feature using following link.
https://myaccount.google.com/u/0/apppasswords

As shown in following image, Use 16 digit code provided by google in place of password.

enter image description here

Vaibhav Jain
  • 1,939
  • 26
  • 36
-3

Hi dear adnan first of all please change the MAIL_USERNAME=test@gmail.com to real Gmail account. And make your that email you are using not have setup 2 step authentication or any security.....

And the second please remove bactick from MAIL_FROM_NAME=""`

After all don't forget to clear cache

Run: php artisan optimize:clear

  • Dear Ashir, Its don't work because gmail change is policy regarding the option "Less secure apps & your Google Account" This setting is no longer available please make sure is gmail is working – Adnan Zaheer Jun 15 '22 at 09:10
  • @AdnanZaheer google doesn't change the policy but Google updates the section and makes things easier I hope you got it. – Ashir Ali Butt Sep 23 '22 at 07:31