Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
message-service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 3d5a9743
authored
2020-07-19 15:50:38 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Copio metodo twilio de codificacion
1 parent
765e8895
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
services.py
services.py
View file @
3d5a974
...
...
@@ -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
):
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment