From e5d0bd2a890a36f239b72cafbd12a86beb0cadac Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 2 Oct 2012 15:14:10 +0530 Subject: [PATCH] Sending books by email: Allow sending to multiple email addresses at once separated by commas. Fixes #1052332 (Multiple email recipients not receiving ebooks) --- src/calibre/gui2/email.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/email.py b/src/calibre/gui2/email.py index ece6d54e26..4ecf28e519 100644 --- a/src/calibre/gui2/email.py +++ b/src/calibre/gui2/email.py @@ -101,8 +101,10 @@ class Sendmail(object): from_ = 'calibre ' with lopen(attachment, 'rb') as f: msg = compose_mail(from_, to, text, subject, f, aname) - efrom, eto = map(extract_email_address, (from_, to)) - eto = [eto] + efrom = extract_email_address(from_) + eto = [] + for x in to.split(','): + eto.append(extract_email_address(x.strip())) sendmail(msg, efrom, eto, localhost=None, verbose=1, relay=opts.relay_host,