Error - Descargar archivos correo Office365
Publicado por marta (7 intervenciones) el 10/05/2018 12:59:43
Quiero descargar los adjuntos de los correos pero me indica que no tengo ningún adjunto. Alguna idea del error?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
authO365 = (str(usermail),str(passmail))
whitelist=['.pdf','.txt','.jpg']
i = Inbox(authO365,getNow=False)
i.setFilter("IsRead eq false")
i.getMessages()
for email in i.messages:
#print(i.messages)
subject = email.getSubject()
print(subject)
body = email.getBody()
mailsender = email.getSenderEmail()
atta=email.attachments
print(atta) #no hay adjuntos y no hace el bucle
for attachment in atta:
report_name = date_time + '_' + attachment.FileName
attachment.SaveASFile(my_path + '/' + report_name)
print('Attachment saved: ' + report_name)
Valora esta pregunta


0