diff --git a/controle_cotisation/main.py b/controle_cotisation/main.py index 3f8409b..7296a20 100755 --- a/controle_cotisation/main.py +++ b/controle_cotisation/main.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -import os, requests, json, datetime, shutil, quopri, subprocess +import os, requests, json, datetime, shutil, quopri, subprocess, base64 from requests.auth import HTTPBasicAuth from requests.auth import HTTPDigestAuth @@ -105,7 +105,7 @@ def sendmail_with_attachment(headers, data, attachment_header, attachment, endin msg = bytes(headers + "\n", 'utf-8') \ + quopri.encodestring(bytes(data, 'utf-8')) \ + bytes(attachment_header + "\n", 'utf-8') \ - + base64(attachment) \ + + base64.b64encode(attachment) \ + bytes(ending + "\n", 'utf-8') subprocess.run([SENDMAIL_LOCATION, "-t", "-oi"], input=msg)