MailToolsBox – Python Email Library

MailToolsBox – Python Email Library

A modern Python email toolkit with SMTP, IMAP, OAuth2, Jinja2 templates, and async support. Secure, reliable, and production-ready.

MailToolsBox is a modern, pragmatic Python library for sending and receiving emails. It unifies SMTP sending and IMAP retrieval in a single package with a clean, consistent API. Designed with security, reliability, and developer experience in mind, it scales from quick scripts to production services.

🌟 Key Features

πŸš€ Installation

pip install MailToolsBox

πŸ”‘ Quick Start

Send a basic email

from MailToolsBox import EmailSender

sender = EmailSender(
    user_email="you@example.com",
    server_smtp_address="smtp.example.com",
    user_email_password="password",
    port=587,
    security_mode="starttls"
)

sender.send(
    recipients=["to@example.com"],
    subject="Hello",
    message_body="Plain text body"
)

Read emails

from MailToolsBox.imap_client import ImapClient

with ImapClient(
    email_account="you@example.com",
    password="password",
    server_address="imap.example.com",
    port=993,
    security_mode="ssl"
) as imap:
    imap.select("INBOX")
    uids = imap.search("UNSEEN")
    messages = imap.fetch_many(uids[:10])
    for m in messages:
        print(m.subject, m.from_[0].email if m.from_ else None)

πŸ”’ Security Modes

πŸ“§ Advanced Features

πŸ“Š Popularity

🀝 Contributing

πŸ“œ License

MIT License β€” free to use and modify.


MailToolsBox makes email in Python simple, secure, and powerful. Whether you’re automating reports, building integrations, or managing mailboxes, this library gives you all the tools you need.

Downloads

Links