1
"""Base email backend class."""
3
class BaseEmailBackend(object):
5
Base class for email backend implementations.
7
Subclasses must at least overwrite send_messages().
9
def __init__(self, fail_silently=False, **kwargs):
10
self.fail_silently = fail_silently
13
"""Open a network connection.
15
This method can be overwritten by backend implementations to
16
open a network connection.
18
It's up to the backend implementation to track the status of
19
a network connection if it's needed by the backend.
21
This method can be called by applications to force a single
22
network connection to be used when sending mails. See the
23
send_messages() method of the SMTP backend for a reference
26
The default implementation does nothing.
31
"""Close a network connection."""
34
def send_messages(self, email_messages):
36
Sends one or more EmailMessage objects and returns the number of email
39
raise NotImplementedError