diff --git a/django/core/mail.py b/django/core/mail.py
index 6a45b46..677d59f 100644
a
|
b
|
from email.MIMEText import MIMEText
|
13 | 13 | from email.MIMEMultipart import MIMEMultipart |
14 | 14 | from email.MIMEBase import MIMEBase |
15 | 15 | from email.Header import Header |
16 | | from email.Utils import formatdate, parseaddr, formataddr |
| 16 | from email.Utils import formatdate, parseaddr, formataddr, getaddresses |
17 | 17 | |
18 | 18 | from django.conf import settings |
19 | 19 | from django.utils.encoding import smart_str, force_unicode |
… |
… |
def forbid_multi_line_headers(name, val):
|
79 | 79 | except UnicodeEncodeError: |
80 | 80 | if name.lower() in ('to', 'from', 'cc'): |
81 | 81 | result = [] |
82 | | for item in val.split(', '): |
83 | | nm, addr = parseaddr(item) |
| 82 | for nm,addr in getaddresses( (val,) ): |
84 | 83 | nm = str(Header(nm, settings.DEFAULT_CHARSET)) |
85 | 84 | result.append(formataddr((nm, str(addr)))) |
86 | 85 | val = ', '.join(result) |