From 7efc79ca6ed57ba096321eef40e6bb8f78e7d404 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 31 May 2021 17:40:51 +0200 Subject: [PATCH] connection.py: send messages as binary data through stdio --- flask_sendmail/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_sendmail/connection.py b/flask_sendmail/connection.py index b7d65bc..8e0cee5 100644 --- a/flask_sendmail/connection.py +++ b/flask_sendmail/connection.py @@ -20,7 +20,7 @@ def __enter__(self): def send(self, message): sm = Popen([self.mail.mailer, self.mail.mailer_flags], stdin=PIPE, stdout=PIPE, stderr=STDOUT) - sm.stdin.write(message.dump()) + sm.stdin.write(message.dump().encode()) sm.communicate() return sm.returncode