phplaravelemailsmtpgmail

Gmail SMTP server stopped working as it no longer support "Less Secure Apps"


I am working on Laravel project and suddenly emails stopped working. After searching I figured out that Google as stopped support for Less Secure Apps and now I no longer see the option to enable or disable it in My Account.

But now I'm not sure how to make it working again as all the results that I search on internet are related to the old method. I want to make it working on localhost.

Here is more detailed link which I found - https://support.google.com/accounts/answer/6010255


Solution

  • 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
    2. Go to Security setting and Enable 2 factor 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.