Exclude empty email addresses from the send list.
- Legacy-Id: 7552
This commit is contained in:
parent
521b42436d
commit
af4c6e253c
|
@ -71,7 +71,7 @@ def send_smtp(msg, bcc=None):
|
|||
addrlist = msg.get_all('To') + msg.get_all('Cc', [])
|
||||
if bcc:
|
||||
addrlist += [bcc]
|
||||
to = [addr for name, addr in getaddresses(addrlist)]
|
||||
to = [addr for name, addr in getaddresses(addrlist) if addr != '' ]
|
||||
if not to:
|
||||
log("No addressees for email from '%s', subject '%s'. Nothing sent." % (frm, msg.get('Subject', '[no subject]')))
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue