Error getting atachments from Office365 email

python
Tags: #<Tag:0x00007fb87cfb2e80>

#1

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")
   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)
           for attachment in atta:    #this loop
    
               report_name = date_time + '_' + attachment.FileName

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

#2

Is this post ImageJ- or Fiji-related?

If not please remove this post from the Forum.

Thanks

Herbie