diff --git a/hedgedoc-expire.py b/hedgedoc-expire.py index b85fa26..b18ace8 100644 --- a/hedgedoc-expire.py +++ b/hedgedoc-expire.py @@ -232,7 +232,7 @@ class HedgedocExpire: '''))) md = MIMEBase('text', 'markdown') md.add_header('Content-Disposition', f'attachment; filename={note["title"]}.md') - md.set_payload(note["content"]) + md.set_payload(note["content"].encode(encoding='utf-8')) msg.attach(md) self.email_sender.send(msg) @@ -243,7 +243,7 @@ class HedgedocExpire: url = self.config.url + '/' + (note["alias"] if note["alias"] is not None else note["shortid"]) print(f'Note "{note["title"]}" ({url}) emailed to {msg["To"]}') except Exception as e: - print(f'Unable to send email to {note["email"]}: {e}', file=sys.stderr) + print(f'Unable to send email to {self.email_from_email_or_profile(note)}: {e}', file=sys.stderr) def expire_old_revisions(self, db) -> None: """