Step 1. Enable Gmail API service Log in to your Google Cloud Platform, Select your project Enable Gmail API service
Step 2. Install Python Library
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
#IMPORTANT: DO DOWNLOAD AND SAVE .JSON FILE FROM GOOGLE-CLOUD-PLATFORM
References Gmail Scopes (https://developers.google.com/gmail/api/auth/scopes) Email Mime (https://docs.python.org/3/library/email.mime.html)