From 43f8a99f8958f8934d76f9e2a9be48626aa17178 Mon Sep 17 00:00:00 2001 From: LV-426 Date: Tue, 20 Jan 2015 03:35:59 +0200 Subject: rz_mail.py: misc --- src/server/rz_mail.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/server') diff --git a/src/server/rz_mail.py b/src/server/rz_mail.py index fc1fa75a..3eadad20 100644 --- a/src/server/rz_mail.py +++ b/src/server/rz_mail.py @@ -12,8 +12,10 @@ import smtplib log = logging.getLogger('rhizi') def send_message(recipients, subject, attachments, body): + send_from = current_app.rz_config.mail_default_sender smtp_hostname = current_app.rz_config.mail_hostname + send_message_helper(smtp_hostname=smtp_hostname, send_from=send_from, recipients=recipients, subject=subject, attachments=attachments, body=body) @@ -28,6 +30,7 @@ def send_message_helper(smtp_hostname, send_from, recipients, subject, attachmen python batteries-included packages """ assert isinstance(recipients, list) + msg = MIMEMultipart() msg['From'] = send_from msg['To'] = COMMASPACE.join(recipients) @@ -41,7 +44,7 @@ def send_message_helper(smtp_hostname, send_from, recipients, subject, attachmen part.set_payload(data) Encoders.encode_base64(part) part.add_header('Content-Disposition', 'attachment', filename=filename) - #Content_Disposition: attachment; filename="feedback_page.html" + # Content_Disposition: attachment; filename="feedback_page.html" msg.attach(part) smtp = smtplib.SMTP(smtp_hostname) -- cgit v1.3.1