Less Secure Apps Setting In Gmail. If you would like to configure your gmail account in outlook or other any other client you must be enabled this feature. You can access your gmail account in your python code now. Unable to send mail through smtp.gmail.com.
(note to google apps users: Toggle to turn this feature 'on'.
So, it is advisable to use this when no other option is available.
But as google said this action is not recommended, because there will be risks for you gmail account. If less secure app access is on for your account because less secure apps can make your account more vulnerable, google will automatically turn this setting off if it’s not being used. But as google said this action is not recommended, because there will be risks for you gmail account. Select the setting for less secure apps: