skillfed

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)

django-anymail v15.1 3.2M downloads/30d#2,703 on PyPI1,895
Permissive license BSD-3-Clause Active released

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-anymail

uv

uv add django-anymail

poetry

poetry add django-anymail

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Communications :: EmailTopic :: Software Development :: Libraries :: Python Modules

Tags

django email backend ESPtransactional email djangomailgun sendgrid django integrationdjango email service provideremail tracking webhooks djangoinbound email djangodjango email abstraction layer
email-backendesp-abstractiondjango-integration

More Python Modules packages