A command-line interface tool for sending and receiving emails securely and efficiently using Python. Includes support for email scanning, CLI flags, and cross-platform script shortcuts.
- β Send and receive emails via command line
- πΎ Custom email filtering (future enhancement)
- π‘ Attachment safety scan (new!)
- Scans attachments before download using the VirusTotal API
- Prompts user based on the scan result
- Helps avoid downloading malicious files
- π₯οΈ Windows Command Interface Support
- Run CLI scripts globally from CMD or PowerShell
.batscripts added inscript/folder- Works via terminal shortcut using Pythonβs
-mmodule support
- π Optional: OAuth authentication (planned)
- π Enhanced security checks for malicious attachments and phishing emails
- Detects suspicious links and common phishing patterns
- Warns users before opening or downloading risky content
- π
Schedule emails for future delivery
- Set specific dates and times to send emails automatically
System Requirements
- Python 3.6 or higher
- An active SMTP-enabled email account (e.g., Gmail, Outlook, Yahoo)
Required Python Libraries
Install the required dependencies using pip:
pip install smtplib imaplib argparse getpass email- Clone this repository:
git clone https://github.com/coding-enthusiast003/python-email-projects.git cd python-email-projects-
Sending Emails
python -m send_mails.send3 -u "youremail@gmail.com" -r "recipient@example.com" -t "Subject" -b "Message Body"
Note:
In thesend3module, you can either provide all arguments via the command line, or just specify your email address (-u). If you omit other options, the script will interactively prompt you for the remaining details (recipient, subject, body, etc.). Enter your email password securely when prompted. -
Receiving Emails
python -m received_mails.receiver2 -s "example@gmail.com"Securely prompted for entering password
-
You can run the email sender and receiver from any terminal (CMD or PowerShell) using simple commands.
Create a folder for your scripts (e.g., D:\scripts) and inside that folder, create two .bat files:
@echo off
REM Change this path to the root of your project directory
cd /d "D:\email-project"
python -m send_mails.send2 %*@echo off
REM Change this path to the root of your project directory
cd /d "D:\email-project"
python -m received_mails.receiver2 %*- Press
Win + S, search for Environment Variables, and open it - Click Environment Variables
- Under System variables, select
Pathβ click Edit - Click New β paste the path where your
.batfiles are located (e.g.,D:\scripts\) - Click OK to apply the changes
Now you can simply open Command Prompt or PowerShell and type:
email-send -s "your_email@gmail.com"
email-receive -u "your_email@gmail.com"- DO NOT hardcode email credentials inside the script.
- Use environment variables or a configuration file.
- Consider OAuth authentication for better security.
- π’ Bulk email sending with rate limits
- π‘οΈ Implementing OAuth authentication for enhanced security
Feel free to fork this repository and submit pull requests with improvements!
This project is licensed under the MIT License.
Made with β€οΈ by [Subham Das (coding-enthusiast003)]