lovnishverma/certificate-email-sender
This Python script automates the process of sending bulk emails with attachments (certificates) using Mailjet's API. With Mailjet's free tier, you can send up to 200 emails per day (6,000 emails per month) instantly without any cost.
Certificate Email Sender - Mailjet GUI v1.4
A professional desktop application for sending personalized certificate emails in bulk using the Mailjet API. Built with Python and Tkinter, featuring an intuitive GUI, real-time progress tracking, and comprehensive error handling.
๐ Quick Start
For Windows Users (No Python Required):
- Download
mailjet.exefrom Releases - Double-click to launch the application
- Follow the setup wizard in the GUI
For Python Users:
git clone https://github.com/lovnishverma/certificate-email-sender.git
cd certificate-email-sender
pip install -r requirements.txt
python mailjet.py๐ Table of Contents
- Features
- Prerequisites
- Installation
- Configuration
- Usage
- Data Format Requirements
- Troubleshooting
- Building from Source
- Contributing
- License
โจ Features
Core Functionality
- Bulk Email Sending: Send personalized certificates to multiple recipients
- Multi-format Support: Compatible with Excel (
.xlsx) and CSV (.csv) files - PDF Attachment: Automatically attach certificates based on certificate numbers
- Email Validation: Built-in validation to prevent sending to invalid addresses
User Experience
- Intuitive GUI: Clean, user-friendly interface built with Tkinter
- Real-time Progress: Live progress bar and detailed logging
- Summary Reports: Comprehensive email delivery summary sent to sender
- Secure Configuration: Encrypted API key storage with masked input fields
Technical Features
- Error Handling: Robust error detection and recovery
- Configuration Persistence: Auto-saves settings in
config.json - Cross-platform: Runs on Windows, macOS, and Linux
- Standalone Executable: Windows
.exeversion requires no Python installation
๐ฆ Prerequisites
For Python Installation
- Python 3.7 or higher
- Active internet connection
- Mailjet account with API credentials
For Windows Executable
- Windows 10 or later
- Active internet connection
- Mailjet account with API credentials
Mailjet Account Setup
- Create a free account at Mailjet.com
- Navigate to Account Settings โ REST API โ API Key Management
- Generate your API Key and Secret Key
- Keep these credentials secure - you'll need them for the application
๐ ๏ธ Installation
Python Installation
Step 1: Clone the Repository
git clone https://github.com/yourusername/certificate-email-sender.git
cd certificate-email-senderStep 2: Create Virtual Environment (Recommended)
# Create virtual environment
python -m venv certificate_sender_env
# Activate virtual environment
# Windows:
certificate_sender_env\Scripts\activate
# macOS/Linux:
source certificate_sender_env/bin/activateStep 3: Install Dependencies
pip install -r requirements.txtStep 4: Launch Application
python mailjet.pyWindows Executable
- Download the latest
mailjet.exefrom the Releases page - Save to your preferred location (no installation required)
- Double-click
mailjet.exeto launch - Windows may show a security warning - click "More info" โ "Run anyway"
โ๏ธ Configuration
First-Time Setup
- Launch the application
- Enter your Mailjet API credentials:
- API Key: Your Mailjet public key
- API Secret: Your Mailjet private key (masked for security)
- Sender Name: Display name for outgoing emails
- Sender Email: Must be verified in your Mailjet account
Configuration File
Settings are automatically saved to config.json in the application directory:
{
"api_key": "your_api_key",
"api_secret": "your_api_secret",
"sender_name": "Your Organization",
"sender_email": "certificates@yourorg.com"
}Security Note: Keep config.json secure and never share it publicly.
๐ Usage
Step-by-Step Process
1. Prepare Your Data
Create an Excel or CSV file with the following columns:
full_name: Recipient's complete nameemail: Recipient's email addresscert_no: Unique certificate identifier
2. Organize Certificate Files
- Place all PDF certificates in a single folder
- Name each certificate file exactly as:
{cert_no}.pdf - Example: If
cert_nois "CERT101", the file should be named "CERT101.pdf"
3. Configure Email Content
- Subject Line: Customize the email subject
- Email Body: Write your personalized message
- Use placeholders:
{full_name}- Replaced with recipient's name{cert_no}- Replaced with certificate number
4. Start Sending
- Click "Browse" to select your data file
- Click "Browse" to select your certificates folder
- Verify all settings are correct
- Click "Start Sending Emails"
- Monitor progress in the log window
Example Email Template
Subject: Your Certificate - Congratulations {full_name}!
Dear {full_name},
Congratulations on your achievement! Please find your certificate ({cert_no}) attached to this email.
Best regards,
The Certification Team
๐ Data Format Requirements
Required Columns
Your data file must contain these exact column names:
| Column | Description | Example |
|---|---|---|
full_name |
Recipient's complete name | "John Smith" |
email |
Valid email address | "john@example.com" |
cert_no |
Unique certificate identifier | "CERT001" |
Sample Data File
CSV Format:
full_name,email,cert_no
John Smith,john@example.com,CERT001
Jane Doe,jane@example.com,CERT002
Bob Johnson,bob@example.com,CERT003Excel Format:
| full_name | cert_no | |
|---|---|---|
| John Smith | john@example.com | CERT001 |
| Jane Doe | jane@example.com | CERT002 |
| Bob Johnson | bob@example.com | CERT003 |
File Naming Convention
Certificate PDF files must be named exactly as the cert_no value:
- CERT001.pdf
- CERT002.pdf
- CERT003.pdf
๐ Progress Tracking & Reporting
Real-time Monitoring
- Progress Bar: Visual indication of completion percentage
- Live Log: Detailed status updates for each email
- Error Reporting: Immediate notification of any issues
Summary Email
Upon completion, a summary report is automatically sent to the sender's email containing:
- Total records processed
- Number of emails sent successfully
- Number of failed deliveries
- List of failed recipients (if any)
- Processing time and timestamp
๐ ๏ธ Troubleshooting
Common Issues and Solutions
| Issue | Possible Cause | Solution |
|---|---|---|
| "Invalid email format" | Email doesn't match standard format | Verify email addresses in your data file |
| "Certificate not found" | PDF file missing or incorrectly named | Ensure {cert_no}.pdf exists in certificates folder |
| "API authentication failed" | Incorrect Mailjet credentials | Verify API Key and Secret in Mailjet dashboard |
| "Daily limit exceeded" | Mailjet sending limit reached | Wait 24 hours or upgrade your Mailjet plan |
| "Application won't start" | Missing dependencies or corrupted installation | Reinstall Python dependencies or re-download executable |
| "Permission denied" | Insufficient file access rights | Run as administrator or check file permissions |
Debug Mode
To enable detailed logging:
- Open command prompt/terminal
- Navigate to application directory
- Run:
python mailjet.py --debug(Python version only)
Getting Help
If you encounter persistent issues:
- Check the Issues page
- Create a new issue with:
- Your operating system
- Application version
- Error message (if any)
- Steps to reproduce the problem
๐ง Building from Source
Creating Windows Executable
Prerequisites
pip install pyinstallerBuild Command
pyinstaller --noconfirm --onefile --windowed --name="Certificate_Email_Sender" mailjet.pyAdvanced Build Options
pyinstaller --noconfirm --onefile --windowed \
--add-data="config.json;." \
--icon="icon.ico" \
--name="Certificate_Email_Sender" \
mailjet.pyThe executable will be created in the dist/ directory.
Project Structure
certificate_email_sender/
โโโ mailjet.py # Main application code
โโโ config.json # Configuration file (auto-generated)
โโโ requirements.txt # Python dependencies
โโโ README.md # This documentation
โโโ LICENSE # License file
โโโ .gitignore # Git ignore rules
โโโ dist/ # Built executables
โ โโโ Certificate_Email_Sender.exe
โโโ build/ # Build artifacts
โโโ mailjet.spec # PyInstaller configuration
๐ฆ Dependencies
mailjet-rest==1.3.4
pandas>=1.3.0
tqdm>=4.62.0
openpyxl>=3.0.9๐ค Contributing
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes and test thoroughly
- Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Submit a Pull Request
Development Guidelines
- Follow PEP 8 style guidelines
- Add comments for complex logic
- Test on multiple platforms when possible
- Update documentation for new features
๐ License
This project is licensed under the MIT License. See the LICENSE file for details.
๐ Acknowledgements
Built With
- Mailjet API - Email delivery service
- Python Tkinter - GUI framework
- Pandas - Data manipulation
- PyInstaller - Executable creation
Special Thanks
- Mailjet team for providing reliable email API
- Python community for excellent libraries
- Beta testers for valuable feedback
๐ Support
- Documentation: This README and inline code comments
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with โค๏ธ by Lovnish Verma
โญ Star this project | ๐ Report Bug | ๐ก Request Feature