diff -r 4803a6d569f7 Lib/smtplib.py --- a/Lib/smtplib.py Mon Apr 27 17:49:16 2015 +0300 +++ b/Lib/smtplib.py Mon Apr 27 23:57:27 2015 +0300 @@ -52,6 +52,7 @@ import copy import datetime import sys +from itertools import chain from email.base64mime import body_encode as encode_base64 __all__ = ["SMTPException", "SMTPServerDisconnected", "SMTPResponseException", @@ -868,10 +869,8 @@ if (header_prefix + 'Sender') in msg else msg[header_prefix + 'From']) if to_addrs is None: - addr_fields = [f for f in (msg[header_prefix + 'To'], - msg[header_prefix + 'Bcc'], - msg[header_prefix + 'Cc']) if f is not None] - to_addrs = [a[1] for a in email.utils.getaddresses(addr_fields)] + addr_fields = [msg.get_all(f, []) for f in ('To', 'Bcc', 'Cc')] + to_addrs = [a[1] for a in email.utils.getaddresses(chain(*addr_fields))] # Make a local copy so we can delete the bcc headers. msg_copy = copy.copy(msg) del msg_copy['Bcc']