[Solved] Sending and email using python - Problem causes by last Google policy update (on less secure apps)

Python Mohit Mozumder

Problem:

from 30/05/2022 (despite the fact that everybody is free to do whatever he wants with his account) google has a new politic that states:

To help keep your account secure, starting May 30, 2022 , Google will
no longer support the use of third-party apps or devices that only ask 
for your username and password for you. sign in to your Google account

So my question is there any other way to send an email using python (include to an email account belonging to an other company)?


Solution:

Follow those steps-

  1. Log in into your email account: https://myaccount.google.com

  2. Then go to the security part

      Be sure that you have turn on two steps verification and click on "App password"

  1. After select email and the corresponding device

  1. It will generate a password that will look like this; it is this password that you have to use in your python script.

  1. This password will appear here; in this place, you will have the option to erase it (so it will be no longer be useful to connect to your email account).



Thank you for reading the article. For any query feel free to contact with us.