Auto Emailer is a Python-based script designed to automate sending personalized emails with optional attachments. This tool reads contact information from a CSV file, dynamically customizes email templates, and sends emails using an SMTP server (e.g., Gmail).
- Read contact details from a CSV file.
- Dynamically customize email templates based on recipient information.
- Add multiple attachments.
- Supports multilingual email templates.
- Handles invalid email addresses gracefully.
python3 -m venv venv
source venv/bin/activate
pip install python-dotenv
- Create an App Password for your email account.
- This is more secure than using your account password.
Configure the .env file in the project directory with your credentials:
EMAIL_ADDRESS="your_email@gmail.com"
EMAIL_PASSWORD="your_app_password"
- Contact List:
- Create a CSV file with contact information (e.g., name, email, preferred language).
- Save this file in the
docs/
folder.
- Attachments:
- Add any files you want to send as email attachments to the
attachments/
folder. - The
.gitkeep
file will be ignored.
- Email Templates:
- Create text files for each language you plan to support (e.g., email_CA.txt, email_ES.txt).
- Save these files in the
docs/
folder.
python auto-emailer.py
auto-emailer/
├── attachments/ # Folder for all email attachments
├── docs/ # Folder for email templates and contact CSV
├── auto-emailer.py # Main script
├── .env # Environment variables
├── LICENSE # Project license
├── README.md # Documentation
- Use responsibly: Ensure you have the consent of your recipients before sending emails.
- Respect privacy: Avoid sharing or misusing recipient information.
- Avoid spamming: This script is not intended for sending unsolicited emails.
Misuse of this tool may violate laws such as the CAN-SPAM Act, GDPR, or other regulations in your jurisdiction.
This project is licensed under the MIT License.
Contributions are welcome! If you have suggestions for improvements, feel free to create an issue or submit a pull request.
If you encounter any issues or have questions, please open an issue on the GitHub repository.