BaseEmailBackend
Base class for email backend implementations.
Attributes
| Attribute | Type | Description |
|---|---|---|
| alias | string = None | The unique identifier for the mailer configuration used to initialize the backend. |
| _fail_silently | boolean = False | Internal flag determining whether to suppress exceptions during email delivery. |
Constructor
Signature
def BaseEmailBackend(
fail_silently: Any = _NOT_PROVIDED,
alias: str = None,
_ignore_unknown_kwargs: list = None,
**kwargs: dict
)
Parameters
| Name | Type | Description |
|---|---|---|
| fail_silently | Any = _NOT_PROVIDED | Whether to suppress exceptions during email sending. |
| alias | str = None | The alias name for the backend instance. |
| _ignore_unknown_kwargs | list = None | A list of keyword arguments to ignore during initialization. |
| **kwargs | dict | Additional keyword arguments for backend configuration. |
Methods
open()
@classmethod
def open() - > null
Open a network connection. This method can be overwritten by backend implementations to open a network connection.
Returns
| Type | Description |
|---|---|
null | Nothing is returned by the default implementation. |
close()
@classmethod
def close() - > null
Close a network connection.
Returns
| Type | Description |
|---|---|
null | Nothing is returned. |
send_messages()
@classmethod
def send_messages(
email_messages: list
) - > integer
Send one or more EmailMessage objects and return the number of email messages sent.
Parameters
| Name | Type | Description |
|---|---|---|
| email_messages | list | A collection of EmailMessage objects to be dispatched by the backend |
Returns
| Type | Description |
|---|---|
integer | The total count of email messages successfully processed and sent. |