A A secure Flask-based email API that supports sending HTML emails with attachments to multiple recipients using multiple Gmail SMTP accounts. Features include dynamic sender account selection, IP whitelist restrictions for added security, and .env-based configuration for easy setup and management.
A secure Flask-based email API using multiple Gmail SMTP accounts, with:
gmail1
, gmail2
, etc.).env
.env
git clone https://github.com/sujit-codezen/stmp-mail.git cd flask-smtp-email-api
python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt
# Gmail Account 1 GMAIL1_SMTP_SERVER=smtp.gmail.com GMAIL1_SMTP_PORT=587 GMAIL1_EMAIL=your_account1@gmail.com GMAIL1_PASSWORD=your_app_password_1 # Gmail Account 2 GMAIL2_SMTP_SERVER=smtp.gmail.com GMAIL2_SMTP_PORT=587 GMAIL2_EMAIL=your_account2@gmail.com GMAIL2_PASSWORD=your_app_password_2 # Allowed IPs (comma-separated) ALLOWED_IPS=127.0.0.1,123.45.67.89
python app.py