diff options
| author | Igor Tokarev <TigorC@gmail.com> | 2017-08-28 09:28:18 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-09-04 08:46:11 -0400 |
| commit | af35c69a3c595ff77188ff0d7dac6ab747484ac3 (patch) | |
| tree | 49cfc11a8dd776bbd36e87992271bba5cda5b0c8 /django | |
| parent | d81c86d32c6b716e49288c22c80ceb6ee924531f (diff) | |
Fixed #26344 -- Made EmailMessage include alternatives when the body is empty and it has attachments.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/mail/message.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/mail/message.py b/django/core/mail/message.py index eb10ff1b73..9c68b8be6d 100644 --- a/django/core/mail/message.py +++ b/django/core/mail/message.py @@ -354,7 +354,7 @@ class EmailMessage: encoding = self.encoding or settings.DEFAULT_CHARSET body_msg = msg msg = SafeMIMEMultipart(_subtype=self.mixed_subtype, encoding=encoding) - if self.body: + if self.body or body_msg.is_multipart(): msg.attach(body_msg) for attachment in self.attachments: if isinstance(attachment, MIMEBase): |
