Skip to content

Commit

Permalink
Merge pull request #54 from gisce/fix_attatchments
Browse files Browse the repository at this point in the history
fix attachment
  • Loading branch information
polsala authored Nov 14, 2023
2 parents cb46d1c + 776e79d commit ed6c2de
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions qreu/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from email.utils import formatdate, make_msgid
from datetime import datetime

import six
from html2text import html2text
from six import PY2
if PY2:
Expand Down Expand Up @@ -372,8 +373,11 @@ def add_attachment(self, input_buff, attname=False):
import base64

content = input_buff.getvalue() if isinstance(input_buff, (StringIO, BytesIO)) else input_buff.read()
# attachment_str = base64.encodestring(content)
attachment_str = content.decode('utf-8')
if six.PY2:
attachment_str = base64.encodestring(content)
else:
# TODO Revisar
attachment_str = content.decode('utf-8')


filetype = mimetypes.guess_type(filename)[0]
Expand Down

0 comments on commit ed6c2de

Please sign in to comment.