MailR is a gmail automation bot that you can use for automating your mails.
- Logs into Gmail account securely.
- Automates sending your report files (*.xlsx) via gmail.
You can download requirements by running libraries.bat
file or executing following in your terminal after cloning:
pip install -r requirements.txt
# Clone the repo
git clone https://github.com/pushkar009/MailR.git
# change working directory
cd MailR
# Note: Setup Gmail api before executing
python MailR.py
# P.S.- You have to login for the first time in order to create token.json
Step 1: Go to Google Cloud Console
- Click "Select a Project" → "New Project"
- Name:
Gmail Bot
- In the sidebar:
APIs & Services > Library
- Search for “Gmail API” → Click it → Click Enable
- Go to
APIs & Services > OAuth Consent Screen
- Go to Branding
- Fill out required fields (like app name, email, etc.) click save
- Choose External in Audience (it's just for you)
- Scroll to “Test Users” section.
- Click
Add Users
. - Enter the email address you’re using to run the script (e.g., your Gmail account).
- Click Save.
This tells Google: “Hey, it’s okay, I trust this bot. It's just me using it for now.”
- Go to
APIs & Services > Credentials
- Click "Create Credentials" > "OAuth Client ID"
- App type:
Desktop app
- Click Create and then Download the
credentials.json
file
Note:Save this credentials.json file in the same folder as your Python script.
Run the script once manually:
python gmail_bot.py
You’ll get a Google login popup to give permission. After that, it will save a token.json file for future use—so no popup next time.