'How to fix less secure app access problem in Gmail ...?

Google is getting rid of less secure app access feature. I'm using smtp email service for my website's contact page. But after 30 May, 2022 this service will not work probably.

Is there any other way to give third party less secure app access to my Gmail account ..?

Can an app password solve this problem ..? I have doubts that setting app password will not give access either as google said this may not work for less secure app.

So is there any way to fix this so that the smtp email service works as it should ...?



Solution 1:[1]

TLDR:

Caveats:

  • Initially, Gmail had automatically turned off my less secure apps setting because I hadn't used that test account in several months. I turned it on, but since I saw the message that it'd be disabled by 2022.05.30, I went ahead and set the app password. This means my current setup has both less secure apps AND app password enabled in my Gmail account, though I'm only using the app password for authentication.
  • My program usually ran from within WSL2 on top of Windows 11. Even after setting up the app password, my code was returning a gaierror: [Errno -3] Temporary failure in name resolution error when running from within WSL2. I then tried running it straight from Windows 11 and it worked just fine. I now need to fix the networking issue causing this, but it doesn't seem to be directly caused by using app password.

I hope this helps.

Solution 2:[2]

It can be done via 2 factor authentication and app password

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Leobeeson
Solution 2 Truck