I have something like this:
protocol = MSGraphProtocol(api_version='beta')
account = Account(credentials, protocol=protocol, auth_flow_type='credentials', tenant_id=tenant_id)
mailbox = account.mailbox(resource='john.doe@mail.com')
inbox = mailbox.inbox_folder()
messages = inbox.get_messages(limit=50, download_attachments=True)
for message in messages:
if message.has_attachments:
print(#print attachment name here)
I'm not exactly sure how to access the name attribute or whatever attribute will pull the name. Inspecting the object it looks like there is a name attribute from the BaseAttachments class but if i try something like message.attachments.name it always tells me that attribute doesn't exist.
Tried looking through the source code but I can't figure it out. Any tips?
I have something like this:
protocol = MSGraphProtocol(api_version='beta')
account = Account(credentials, protocol=protocol, auth_flow_type='credentials', tenant_id=tenant_id)
mailbox = account.mailbox(resource='john.doe@mail.com')
inbox = mailbox.inbox_folder()
messages = inbox.get_messages(limit=50, download_attachments=True)
for message in messages:
if message.has_attachments:
print(#print attachment name here)
I'm not exactly sure how to access the name attribute or whatever attribute will pull the name. Inspecting the object it looks like there is a name attribute from the BaseAttachments class but if i try something like message.attachments.name it always tells me that attribute doesn't exist.
Tried looking through the source code but I can't figure it out. Any tips?