Automating emails is a powerful way to save time and ensure timely communication for reminders, reports, notifications, and alerts. This project demonstrates how to send emails programmatically using Python’s built-in smtplib and email modules with Gmail’s SMTP server.
- Send automated emails with custom subject and body
- Supports Gmail SMTP (SSL)
- Useful for reminders, reports, notifications, alerts, and bulk emails
- Lightweight – built using only Python standard libraries
Create a Python script that automates sending emails via SMTP – useful for reminders, reports, or alerts.
- Python 3.x
- Gmail account with App Passwords enabled (for security)
- Enable 2-Step Verification in your Gmail account.
- Generate an App Password from Google (use this instead of your normal Gmail password).
- Replace the placeholders in the script:
email['From'] = 'your_email@gmail.com' smtp.login('your_email@gmail.com', 'your_app_password') send_email('receiver_email@gmail.com', 'Test Subject', 'Hello, this is a test email!')
- Run the script:
python email_automation.py
- Never hardcode your real Gmail password in scripts.
- Always use App Passwords for SMTP authentication.
- Consider storing credentials in environment variables or a
.envfile.
This project is licensed under the MIT License – feel free to use and modify it.
Contributions, issues, and feature requests are welcome!
Feel free to fork this repo and submit pull requests.
If you find this project useful, consider giving it a ⭐ on GitHub.