Installation
MailBridge uses uv as its primary package manager. SMTP and most providers work out of the box — only async support, SendGrid, and Amazon SES require an optional extra.
Requirements
Install
If you don't have uv installed yet:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv add mailbridge
pip install mailbridge
poetry add mailbridge
This installs the core package. SMTP, Postmark, Mailgun and Brevo are included and ready to use — no additional steps needed.
Optional Dependencies
Install only what you need. Async support, SendGrid, and Amazon SES each require an optional extra:
uv add "mailbridge[async]"
pip install "mailbridge[async]"
aiohttp + aiosmtplib — native non-blocking I/O for all providersuv add "mailbridge[sendgrid]"
pip install "mailbridge[sendgrid]"
sendgrid SDKuv add "mailbridge[ses]"
pip install "mailbridge[ses]"
boto3 (AWS SDK)uv add "mailbridge[all]"
pip install "mailbridge[all]"
aiohttp + aiosmtplib + sendgrid + boto3What needs an extra?
| Feature / Provider | Extra | Installs |
|---|---|---|
Async support (AsyncMailBridge) |
[async] |
aiohttp, aiosmtplib |
| SendGrid | [sendgrid] |
sendgrid |
| Amazon SES | [ses] |
boto3 |
| Postmark | ✓ Included — no extra needed | |
| Mailgun | ✓ Included — no extra needed | |
| Brevo | ✓ Included — no extra needed | |
| SMTP | ✓ Included — uses Python stdlib | |
AsyncMailBridge works without the [async] extra — it falls back to a thread pool executor. Install [async] to get native non-blocking I/O via aiohttp and aiosmtplib.
Verify Installation
Confirm MailBridge is installed correctly:
python -c "from mailbridge import MailBridge; print('MailBridge OK')"
Or check the installed version:
pip show mailbridge
If you're using an optional provider, verify that its SDK is also available:
# SendGrid
python -c "import sendgrid; print('sendgrid OK')"
# Amazon SES
python -c "import boto3; print('boto3 OK')"
Which provider should I choose?
Not sure where to start? Here's a quick guide:
Use SMTP with your Gmail or Outlook account. No sign-up, no API keys — works immediately with credentials you already have.
pip install mailbridge # SMTP works out of the box
Use Postmark or SendGrid. Both have excellent deliverability, template support, and are easy to set up. Postmark requires no extra install.
pip install mailbridge # Postmark included
pip install mailbridge[sendgrid] # SendGrid needs the SDK
Use Amazon SES. If you're running on EC2 or Lambda, you can use IAM roles — no API keys needed in your code at all.
pip install mailbridge[ses]
Use SendGrid, Mailgun, or Brevo — all support native batch APIs for sending thousands of emails efficiently.
pip install mailbridge[sendgrid] # SendGrid
pip install mailbridge # Mailgun or Brevo — included
You can switch providers at any time — the rest of your code stays the same. So starting with SMTP for development and switching to SendGrid for production is completely straightforward.