| Subject | From | To | Attachments | Size | Time |
|---|---|---|---|---|---|
| {{ item.meta.subject|default:"(no subject)" }}{% if item.meta.tags %}{% endif %} | {# The sender's name when the header has one, the address in the tooltip; the script searches the tooltip. #}{{ item.meta.from_email|sender }} | {{ item.meta.to|join:", " }} | {% if item.meta.attachments %} {% include "django_mail_preview/_clip.html" %}{{ item.meta.attachments }} {% endif %} | {{ item.meta.size|filesizeformat }} |
No messages match.
{% else %} {# The empty inbox: one glyph, one sentence, the one command that changes it. #}Send a message from your project and it appears here.
python manage.py shell -c "from django.core.mail import send_mail; send_mail('Hello', 'It works.', 'me@example.com', ['you@example.com'])"
Point your project at the capture backend and every message it sends appears here.
# settings.py
{% if mailers %}MAILERS = {
"default": {"BACKEND": "django_mail_preview.backends.EmailBackend"},
}{% else %}EMAIL_BACKEND = "django_mail_preview.backends.EmailBackend"{% endif %}
No previews yet? Add a previews.py to render your templates with sample data.