diff --git a/postmark/django_backend.py b/postmark/django_backend.py index ff963d7..7fd503b 100644 --- a/postmark/django_backend.py +++ b/postmark/django_backend.py @@ -105,6 +105,8 @@ def _build_message(self, message): for item in message.attachments: if isinstance(item, tuple): (f, content, m) = item + if isinstance(content, str): + content = content.encode() content = base64.b64encode(content) # b64decode returns bytes on Python 3. PMMail needs a # str (for JSON serialization). Convert on Python 3