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)