django-anymail
Django email backends and webhooks for Amazon SES, Brevo, MailerSend, Mailgun, Mailjet, Mailtrap, Mandrill, Postal, Postmark, Resend, Scaleway TEM, SendGrid, SparkPost, and Unisender Go (EmailBackend, transactional email tracking and inbound email signals)
What it is and what it does
Django-anymail is a Django email backend that abstracts away the differences between transactional email service providers (ESPs) like Mailgun, SendGrid, Amazon SES, Postmark, and others. Instead of writing code tied to one ESP's API, you configure Anymail to use your chosen provider and then use Django's standard email functions—send_mail, EmailMessage, EmailMultiAlternatives—which Anymail routes through that provider's API. It extends Django's built-in email with ESP-specific features like tags, metadata, click tracking, and inline images, while keeping your code portable so you can switch providers later without rewriting.
Anymail also handles receiving email through ESP webhooks, normalizing inbound messages into a consistent format, and converting ESP tracking notifications (bounces, opens, clicks) into Django signals. It supports batch transactional sends using template and merge features, full Unicode support, and simplified attachment handling. The package is actively maintained, compatible with Django 5.0–6.0 and Python 3.10–3.14, and has no known security vulnerabilities.
Use it for:
- Send transactional emails (password resets, order confirmations) through a reliable ESP without hardcoding a specific provider's API.
- Track email opens, clicks, and bounces by receiving ESP webhooks and converting them to Django signals for analytics.
- Switch email providers (e.g., from Mailgun to SendGrid) by changing one configuration line instead of rewriting email code.
- Send templated batch emails with merge variables using your ESP's native template engine for performance.
- Receive inbound email through an ESP's webhook and process attachments and headers in a normalized, portable way.
- Add metadata and tags to sent emails for segmentation and debugging without writing provider-specific code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sends and receives email in Django through multiple transactional email service providers (ESPs) with a unified API that avoids vendor lock-in.
Yes. Django-anymail is a mature, actively maintained abstraction layer for transactional email that solves real vendor lock-in and portability problems. Low install friction, permissive license, no security vulnerabilities, and broad ESP support make it a solid choice for any Django project that needs reliable email delivery. Install it if you're using Django and any transactional ESP; the abstraction pays for itself the moment you need to switch providers.
Install
django-anymail on PyPI
pip
pip install django-anymailuv
uv add django-anymailpoetry
poetry add django-anymailInstalling django-anymail
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a recent release (15 days old) and steady repository activity. Supports current Python versions (3.10–3.14) and modern Django releases (5.0–6.0).
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install django-anymail[mailgun]
# In settings.py (Django 6.1+):
INSTALLED_APPS = ["anymail"]
MAILERS = {
"default": {
"BACKEND": "anymail.backends.mailgun.EmailBackend",
"OPTIONS": {"api_key": "", "sender_domain": "mg.example.com"},
}
}
# Then use Django's standard email:
from django.core.mail import send_mail
send_mail("Subject", "Body", "from@example.com", ["to@example.com"])
Requires Django 5.0 or later (or earlier versions with EMAIL_BACKEND configuration); each ESP may require its own API credentials.
Verify before relying
- Whether all 14 listed ESPs are equally well-maintained or if some have degraded support.
- Performance characteristics when sending high volumes or using batch transactional features.
- Webhook reliability and latency for inbound message and tracking notification delivery.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — django, idna, requests, typing-extensions, urllib3 |
| Maintenance | actively maintained — 15 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,204,905/month — #2,703 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_anymail-15.1-py3-none-any.whl
Keywords: AWS SES, ActiveCampaign, Amazon SES, Bird, Brevo, Django, ESP, EmailBackend, MailChimp, MailerSend, Mailgun, Mailjet, Mailtrap, Mandrill, Postal, Postmark, Resend, Scaleway, Scaleway TEM, SendGrid, SendinBlue, Simple Email Service, Sinch, SparkPost, Twilio, Unisender Go, email, email backend, email service provider, email tracking, inbound email, transactional mail, webhook
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
mailgunOfficial Python SDK for the Mailgun email…
permissive · top 15,000 on PyPI
mailtrapOfficial Python client for Mailtrap's email…
permissive · top 15,000 on PyPI
repoze-sendmailCouples email sending with Zope transactions,…
permissive · top 15,000 on PyPI
django-sesA Django email backend that routes outgoing…
permissive · top 5,000 on PyPI
django-sendgrid-v5Provides a Django email backend that sends…
permissive · top 15,000 on PyPI
sparkpostOfficial Python client for the SparkPost email…
permissive · top 15,000 on PyPI
mailjet-restA Python wrapper for the Mailjet Email API that…
permissive · top 5,000 on PyPI
django-post_officeDjango Post Office queues and sends emails…
permissive · top 15,000 on PyPI
dj-email-urlConfigures Django email backends from…
permissive · top 15,000 on PyPI
postmarkerPostmarker is a Python client library for the…
permissive · top 5,000 on PyPI