✅ Brand New `EmailSender` Class
- Fully revamped, modernized API for sending emails.
- Supports **HTML emails, plain text, and attachments**.
- Multiple recipients with **To, CC, and BCC** support.
- **TLS/SSL security** for encrypted email transmission.
📂 Enhanced Attachment Handling
- Easily send **multiple files** in one email.
- Improved error handling for missing attachments.
🏗 Jinja2 Template Support
- Create **dynamic HTML emails** using templates.
- Better **separation of content and design**.
🔐 Security & Email Validation
- Uses `email-validator` to check **valid recipient emails**.
- Secure authentication with **TLS/SSL encryption**.
🛠 Logging & Error Handling
- Built-in **logging module** to track issues.
- Graceful handling of **SMTP errors**.
🔄 Backward Compatibility
- The legacy `SendAgent` class is still available.
- Encourages **migration to `EmailSender`**.
---
📥 How to Install/Upgrade
Use `pip` to install or upgrade to the latest version:
sh
pip install --upgrade MailToolsBox
---
🚀 Quick Start
**Sending a Basic Email**
python
from MailToolsBox import EmailSender
sender = EmailSender(
user_email="youremail.com",
server_smtp_address="smtp.example.com",
user_email_password="yourpassword",
port=587
)
sender.send(
recipients=["recipientexample.com"],
subject="Hello from MailToolsBox",
message_body="This is a test email!"
)
**Using Jinja2 Templates**
python
context = {
"username": "John Doe",
"activation_link": "https://example.com/activate"
}
sender.send_template(
recipient="recipientexample.com",
subject="Welcome to Our Service",
template_name="welcome.html",
context=context
)
---
📦 Download Assets
- **📥 mailtoolsbox-1.0.0.tar.gz** (Source distribution)
- **📥 MailToolsBox-1.0.0-py3-none-any.whl** (Pre-built wheel package)
---
📌 Resources
🔗 **Official Documentation**: [rambod.net](https://www.rambod.net)
📦 **PyPI Package**: [MailToolsBox on PyPI](https://pypi.org/project/MailToolsBox/)
🛠 **GitHub Repository**: [MailToolsBox on GitHub](https://github.com/rambod/MailToolsBox)
---
🤝 Contributing
We welcome contributions! If you'd like to improve MailToolsBox:
1. Fork the repository.
2. Create a feature branch.
3. Implement changes and write tests.
4. Submit a **pull request**.
---
📢 **Upgrade to MailToolsBox 1.0.0 today! Let us know your feedback and feature requests! 🚀**