A powerful Streamlit application for automated personalized email campaigns with image generation.
✨ Import Excel Data - Load recipient lists with names, emails, and dates 🎨 Image Generation - Create personalized images with names and dates 📤 Email Automation - Send emails with attachments ⏰ Email Scheduling - Schedule emails for future delivery 🔧 Flexible Modes - Combine or separate days per recipient
SmartMailer/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── assets/
│ ├── fonts/ # Custom fonts (optional)
│ ├── images/
│ │ └── generated/ # Generated personalized images
│ └── templates/ # Template images
├── config/
│ ├── settings.py # Configuration management
│ └── config.json # Saved configuration
├── data/
│ ├── processed/ # Processed data
│ └── uploads/ # Uploaded Excel files
├── services/
│ ├── image_generator.py # Image generation service
│ ├── email_sender.py # Email sending service
│ └── scheduler.py # Email scheduling service
├── tests/ # Unit tests
├── ui/ # UI components (if needed)
└── utils/ # Utility functions
- Clone or create the project directory:
mkdir SmartMailer
cd SmartMailer- Create virtual environment:
python -m venv venv-
Activate virtual environment:
- Windows:
venv\Scripts\activate - Linux/Mac:
source venv/bin/activate
- Windows:
-
Install dependencies:
pip install -r requirements.txtYour Excel file should have these columns:
| Name | Date | |
|---|---|---|
| John Doe | john@example.com | 15/03/2024 |
| Jane Smith | jane@example.com | 20/03/2024 |
- Name: Recipient's name
- Email: Recipient's email address
- Date: Date in DD/MM/YYYY format
- Start the application:
streamlit run app.py-
Configure Email Settings (Sidebar):
- Enter your sender email
- Enter your email password (App password for Gmail)
- Set SMTP server (default: smtp.gmail.com)
- Set SMTP port (default: 587)
-
Import Data:
- Go to "Import Data" tab
- Upload your Excel file
- Verify the data loaded correctly
-
Generate Images:
- Go to "Generate Images" tab
- Upload a template image (PNG/JPEG)
- Adjust text positions and styling
- Click "Generate All Images"
-
Send Emails:
- Go to "Send Emails" tab
- Customize email subject and body
- Choose "Send Now" or "Schedule"
- Click "Send/Schedule Emails"
- One email per person
- All dates combined in a single image
- Example: "Date: 15/03/2024, 20/03/2024, 25/03/2024"
- Separate email for each date
- Individual image per date
- Better for event-specific reminders
To use Gmail as SMTP:
- Enable 2-Factor Authentication
- Generate App Password:
- Go to Google Account → Security
- Select "App passwords"
- Generate password for "Mail"
- Use the generated password in SmartMailer
- Use high-quality template images (PNG recommended)
- Test with a small list first
- Check spam folder if emails not received
- For Gmail, use App Passwords instead of regular password
- Adjust text positions based on your template image
Images not generating:
- Verify template image is uploaded
- Check image format (PNG/JPEG only)
Emails not sending:
- Verify SMTP settings
- Check email credentials
- Ensure internet connection
- For Gmail, use App Password
Excel import errors:
- Verify column names match exactly
- Check date format (DD/MM/YYYY)
- Ensure no empty rows
- Never commit config.json with credentials
- Use environment variables for production
- Use App Passwords for email accounts
- Keep your venv directory private
MIT License - Feel free to use and modify!
For issues or questions, please check the documentation or create an issue in the repository.