How Do I Enable Less Secure Apps On Gmail

When I develop a Python application, sometimes I need to access my Gmail account from the Python source code. But this is not allowed by google by default, you need to configure some settings to make it happen. This article will tell you how to make your Gmail account accessed by less secure apps such as from Python source code.

1. Turn On Allow Less Secure Apps Access Google Account Steps.

  1. Go to web page to log in to your google account.
  2. Click the Security menu item on left, then scroll down on right and click the Turn on access(not recommended) link under the Less secure app access section in right.
  3. Now turn on Allow less secure apps:ON toggle button on the new page.
  4. Now click the back arrow in the title, you can find the Allow less secure apps has been turned on. You can access your Gmail account in your Python code now.
  5. But as google said this action is not recommended, because there will be risks for your Gmail account. So you had better turn it off after your testing to make your google account more safety.

2. How To Fix Can Not Find The Allow Less Secure Apps Option.

  1. If you can not find the Less secure app access section on the Security page right side, this is because your Gmail account has enabled the 2-step verification.
  2. To fix this error, you can either disable the 2-step verification or you can create an app special password for your application, then your less secure apps can access the Gmail account.
  3. First, you should log in to your Google account, then click the Security link on the page left side.
  4. Then on the page right side Signing in to Googlesection, click the App passwords arrow.
  5. It will open the App passwords page. Select Mail in the Select app drop-down list. Select the device from the Select device drop-down list.
  6. You can also select Other (Custom name) from the drop-down list to create your own app password.
  7. Click the Generate button to create the app password.
  8. Now it will popup a Generated app password dialog to let you see the app password and how to use it in your device and application.

3. How Can I Enable ‘Allow Less Secure Apps’ In Google Apps Script.

3.1 Question.

  1. I use Google G Suite to develop google apps.
  2. I want to enable the “Allow less secure apps” option by different domain users in my google apps script.
  3. I can not find this option in the G Suite Admin SDK. How can I do it?

3.2 Answer1.

  1. You can not enable this Allow less secure apps option in your source code programmatically.
  2. You can find this in the Google FAQ.
  3. And there is a workaround you can take as below.
  4. Log in to, then click the Security —> Basic settings.
  5. Then Go to the less secure application settings and check the allow less secure apps option.

10 thoughts on “How Do I Enable Less Secure Apps On Gmail”

  1. Option to enable or turn on less secure apps is disabled. Could you please help to fix the issue. Even I haven’t enable the 2 step verification.

  2. I write a mail sender to use Gmail account to send test emails for testing. But when I run the application, it shows the error message

    Invalid login: Username and Password not accepted. Learn more at

    I follow this article steps, but I can not find the link that can turn “Less secure apps” on in my Gmail account settings. Can anybody tell me how to fix it? Thanks.

  3. I write a Django application and send emails through the Gmail SMTP server ( in this Django application. When I run my Django app, it popups this error, and I follow this article to fix the error. My question is why google treat my Django app as less secure app? How can I make google to think my Django app as secure app?

  4. Hi Susan,

    I have tried doing the same thing that he explained above but I am not able to find less secure apps option over there. kindly help me in solving this.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.