Login

Email backend to BCC all emails

Author:
maikhoepfel
Posted:
October 21, 2013
Language:
Python
Version:
Not specified
Tags:
email backend bcc
Score:
0 (after 0 ratings)

The backend lets you quickly get an idea of all emails that are sent out. Helpful for debugging or keeping an archive of all communications. Use instead of Django's SMTPBackend.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from django.core.mail.backends.smtp import EmailBackend

BCC_ADDRESS = 'bcc@example.com'


class BCCEmailBackend(EmailBackend):

    def _send(self, email_message):
        if not email_message.bcc:
            email_message.bcc = [BCC_ADDRESS, ]

        super(BCCEmailBackend, self)._send(email_message)

More like this

  1. email backend which use sendmail subprocess by pawnhearts 5 years, 1 month ago
  2. Login with email or username by zeeg 6 years, 6 months ago
  3. Email or username authentication with masquerading by petrilli 5 years, 8 months ago
  4. Multiple emails field by cuchac 10 months ago
  5. Render to email by bl4th3rsk1t3 5 years, 10 months ago

Comments

Please login first before commenting.