A professional-grade Python automation engine designed for secure, automated, and anti-blocking email campaigns. This project features a modern Streamlit Dashboard for real-time management and is fully Dockerized for consistent deployment.
It focuses on simulating human behavior to ensure high deliverability rates when reaching out to multiple recipients (e.g., Law Firms, Recruiters, or Leads).
Unlike basic scripts that trigger spam filters, this engine implements advanced patterns to protect your sender reputation:
- Intelligent Rate Limiting: Randomized delays between sends to mimic human pacing.
- Resilient Execution: Automated retry mechanism with intelligent error handling.
- Dynamic Personalization: Injects recipient data (like
{company}) into subjects and bodies in real-time. - Session Security: Credentials are handled via environment variables and secure UI inputs, never hardcoded.
To use this script with Gmail, you must use an App Password:
- Enable 2FA: Turn on 2-Step Verification in your Google Security Settings.
- Generate Password: Search for "App Passwords", select "Mail" (or "Other"), and name it
SMTP Automator. - Secure the Code: Google will show a 16-character code. Copy it. You will paste this into the App Sidebar during execution.
Clone the repository and set up your virtual environment:
# Clone the repository
git clone [https://github.com/RicsonRamos/smtp_email_sender.git](https://github.com/RicsonRamos/smtp_email_sender.git)
cd smtp_email_sender
# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows use: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
### 2. Launching the Dashboard
The easiest way to use the automator is through the Web UI:
```bash
streamlit run app.py
To run the application in a containerized environment:
# Build the image
docker build -t smtp-automator .
# Run with persistent volumes (keeps your settings saved)
docker run -p 8501:8501 \
-v ${PWD}/config:/app/config \
-v ${PWD}/email.txt:/app/email.txt \
-v ${PWD}/data:/app/data \
smtp-automator
Update data/contacts.csv with your targets:
company,email
Law Firm A,contact@firm-a.com
Global Partners,hr@global-partners.com
You can edit the message directly in the Dashboard or modify config/content.py.
- Use
{company}to insert the recipient's firm name. - Use
{sender_name}to insert your name.
Simply upload your PDF or DOCX files through the Dashboard. They will be stored in the attachments/ folder and sent with every email in the campaign.
smtp_email_sender/
├── core/ # SMTP logic and Rate Limiting engine
├── config/ # Configuration files (Subject, Sender Name)
├── data/ # CSV Databases (Contacts and History)
├── attachments/ # Files to be sent as attachments
├── app.py # Streamlit Web Dashboard (Main Entry)
├── runner.py # Orchestrator for the mailing process
└── email.txt # Plain text email body template
The dashboard includes an Analytics section that reads data/finished.csv to show:
- Total emails processed.
- Success vs. Failure rates.
- Detailed logs of each transmission.
This system was built for legitimate, personalized communication. Please use it responsibly and follow anti-spam regulations (CAN-SPAM, GDPR).
Developed by Ricson Ramos | 🖖 Live long and prosper through automation.