Error getting emails' attachments from office365

Error getting emails' attachments from office365
0.0 0


I want to get emails’ attachments drom Office 365, but doent go to the second loop (it seems that there are not attachments, but that is not true). Any idea?

   authO365 = (str(usermail),str(passmail))
   i = Inbox(authO365,getNow=False)
   i.setFilter("IsRead eq false")
   for email in i.messages:
           subject = email.getSubject()
           body = email.getBody()
           mailsender = email.getSenderEmail()
           for attachment in atta:    #this loop
               report_name = date_time + '_' + attachment.FileName

               attachment.SaveASFile(my_path + '/' + report_name)
                print('Attachment saved: ' + report_name)


What’s this line printing?


This prints “[]”, I am really lost right now.