- Features
- Requirements
- Installation
- Setting Up Gmail "Secure App Access"
- Usage
- Configuration
- Troubleshooting
- Contributing
- License
- Glossary
- Manage multiple Gmail accounts from the command line
- Read, send, and forward emails
- View new and older emails
- Colorful and user-friendly interface
- Secure handling of account credentials
- Go to your Google Account's App Passwords page: https://myaccount.google.com/apppasswords
- Select "Mail" and "Other (Custom name)" from the dropdowns.
- Enter a name for the app (e.g., "Gmail CLI").
- Click "Generate".
- Use the generated 16-character password in your
.env
file instead of your regular Gmail password.
Note: Keep this password secret and secure!
For more information or support, please open an issue on the GitHub repository.
- Manage multiple Gmail accounts from the command line
- Read, send, and forward emails
- View new and older emails
- Colorful and user-friendly interface
- Secure handling of account credentials
- Python 3.7 or higher
- pip (Python package installer)
-
Clone the repository:
git clone https://github.com/yourusername/gmail-multi-cli.git cd gmail-multi-cli
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up your
.env
file with your Gmail account credentials (see Configuration section). -
Run the script:
python gmail_multi.py
Create a file named requirements.txt
in your project directory with the following content:
python-dotenv==0.19.2
colorama==0.4.4
An app password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App passwords can only be used with accounts that have 2-Step Verification turned on.
Create and manage your app passwords. You may need to sign in to your Google Account.
If you’ve set up 2-Step Verification but can’t find the option to add an app password, it might be because:
- Your Google Account has 2-Step Verification set up only for security keys.
- You’re logged into a work, school, or another organization account.
- Your Google Account has Advanced Protection.
Tip: Usually, you’ll need to enter an app password once per app or device.
- To create an app password, you need 2-Step Verification on your Google Account.
- Go to your Google Account's App Passwords page: https://myaccount.google.com/apppasswords
- Select "Mail" and "Other (Custom name)" from the dropdowns.
- Enter a name for the app (e.g., "Gmail CLI").
- Click "Generate".
- Use the generated 16-character password in your
.env
file instead of your regular Gmail password.
Note: Keep this password secret and secure!
After installation and setup, run the script:
python gmail_multi.py
Follow the on-screen prompts to:
- Select an account
- Choose an action (read new emails, check older emails, send an email, etc.)
- Perform email operations
Create a .env
file in the project root with your Gmail account credentials:
The app passwrod is 16 letter in lenght with spaces between every 4 lettes, example fejy lpue anye pjeb
So to add the password use this EMAIL_PASS_TheDude=fejy lpue anye pjeb and this format works.
[email protected]
EMAIL_PASS_TheDude=app_password
[email protected]
EMAIL_PASS_Man=app_password
[email protected]
EMAIL_PASS_SpaceMan=app_password
Replace the email addresses and passwords with your actual Gmail credentials.
- Authentication Error: Ensure you've enabled "Less Secure App Access" or are using an App Password.
- Module Not Found Error: Make sure you've installed all required packages (
pip install -r requirements.txt
). - SMTP Connection Error: Check your internet connection and firewall settings.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- CLI: Command Line Interface - a text-based interface for interacting with a program.
- IMAP: Internet Message Access Protocol - used for retrieving emails from a server.
- SMTP: Simple Mail Transfer Protocol - used for sending emails.
- Virtual Environment: An isolated Python environment that allows you to install packages without affecting your system-wide Python installation.
- App Password: A 16-character password that gives a less secure app or device permission to access your Google Account.
For more information or support, please open an issue on the GitHub repository.