Commit 3d5a9743 by Tu Nombre

Copio metodo twilio de codificacion

1 parent 765e8895
......@@ -218,14 +218,17 @@ class Mail(ServiceBase):
if file == 'texto':
objeto = open(filepath, "r")
msg["Body"] = objeto.read()
objeto.close()
else:
objeto = open(filepath, "rb")
adj = {"content":str(base64.b64encode(objeto.read())),
with open('attachment.pdf', 'rb') as f:
contenido = f.read()
f.close()
adj = {"content": base64.b64encode(data).decode(),
"filename": file,
"disposition": "attachment",
"type": "application/pdf"}
msg["Adjuntos"].append(adj)
objeto.close()
return(msg)
def ControlMail(self,stadomail,smtp):
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!