Send emails from Gmail without turning on "Allow less secure apps."

Send emails from Gmail without turning on "Allow less secure apps."

From May 2022, Google will no longer support the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password. You can read more about the update here

Screenshot 2022-06-19 at 4.42.52 PM.png

A large percentage of tutorials on connecting to Gmail covers authentication via supplying a username and password and turning off the "allow less secure app" settings on google. Any app we have now that uses this means of authentication will break as google will block anyone trying to sign in to your account from it: to keep your account safe.

Using Google App Password

A Google app password is a 16-digit passcode that allows an app or device to access your Google Account. With this authentication method, you will be signing in via the 16-digit passcode alone.

1) Set up a 2-Step-Verification for your account: you can skip this step if you have already set up a 2-Step-Verification on your account. You can also check this google tutorial to set up your 2-Step-Verification.

Screenshot 2022-06-19 at 1.57.31 PM.png

2) Generate your app password:

  • Click on App passwords

1.png

  • Select "Other (Custom name)" and input any name of your choice

Screenshot 2022-06-19 at 2.52.47 PM.png

  • Then click generate to generate your passcode.

3) Copy your generated passcode

2.png

4) In your Django settings file, replace your EMAIL_HOST_PASSWORD variable with the new passcode you generated

Screenshot 2022-06-19 at 3.55.58 PM.png

5) If you are not using a Django app, just replace your email service settings password with the passcode you generated.

And voila, you are good to go!