diff options
Diffstat (limited to 'service/pixelated/adapter/pixelated_mail_sender.py')
-rw-r--r-- | service/pixelated/adapter/pixelated_mail_sender.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/service/pixelated/adapter/pixelated_mail_sender.py b/service/pixelated/adapter/pixelated_mail_sender.py index 3ace6814..6f6340da 100644 --- a/service/pixelated/adapter/pixelated_mail_sender.py +++ b/service/pixelated/adapter/pixelated_mail_sender.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import smtplib +from pixelated.support.functional import flatten class PixelatedMailSender(): @@ -22,7 +23,10 @@ class PixelatedMailSender(): self.smtp_client = smtplib.SMTP('localhost', 4650) def sendmail(self, mail): - _from = self.account_email_address - _to = mail.get_to() + recipients = flatten([mail.get_to(), mail.get_cc(), mail.get_bcc()]) - self.smtp_client.sendmail(_from, _to, mail.to_smtp_format(_from=_from)) + self.smtp_client.sendmail( + self.account_email_address, + recipients, + mail.to_smtp_format(_from=self.account_email_address) + ) |