From: Carl Hetherington Date: Sat, 17 Sep 2022 21:36:26 +0000 (+0200) Subject: When emailing multiple addresses, put one in To: and the rest in CC: (#2310). X-Git-Tag: v2.16.27~12 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=67fa57cc3b626fd111582f4954fd848981c792d9 When emailing multiple addresses, put one in To: and the rest in CC: (#2310). --- diff --git a/src/lib/kdm_with_metadata.cc b/src/lib/kdm_with_metadata.cc index bebb5df86..7dee935c4 100644 --- a/src/lib/kdm_with_metadata.cc +++ b/src/lib/kdm_with_metadata.cc @@ -250,7 +250,13 @@ send_emails ( } boost::algorithm::replace_all (body, "$SCREENS", screens.substr (0, screens.length() - 2)); - Emailer email (config->kdm_from(), first->emails(), subject, body); + auto emails = first->emails(); + Emailer email (config->kdm_from(), { emails.front() }, subject, body); + + /* Use CC for the second and subsequent email addresses, so we seem less spammy (#2310) */ + for (auto cc = std::next(emails.begin()); cc != emails.end(); ++cc) { + email.add_cc(*cc); + } for (auto cc: config->kdm_cc()) { email.add_cc (cc);