DEV Community

Cover image for A Python library that lets you switch email providers without changing your code
Radomir Brkovic
Radomir Brkovic

Posted on

A Python library that lets you switch email providers without changing your code

Hey everyone 👋

I’ve recently released Mailbrig, a lightweight Python library that provides a unified interface for sending emails through multiple providers — including SMTP, SendGrid, Mailgun, Brevo (Sendinblue), and Amazon SES.

The main goal was to simplify provider integration — you can switch between them just by changing the configuration, without modifying your code.
It also comes with a small CLI tool for quick testing and setup.

📦 PyPI: Mailbridge
💻 GitHub: Mailbridge

Everything’s open source and tested.
I’d love to hear feedback or suggestions for new providers/features. 🙌

Example:

from mailbridge.mail import Mail

Mail.send(
    to="user@example.com",
    subject="Welcome!",
    body="<h1>Hello from MailBridge!</h1>",
    from_email="no-reply@example.com"
)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)