Replies: 3 comments
-
Hello Frank, I see your question is from at least two weeks ago. I was just working on a similar pice of code, adn in general it looks like what you did. Create an account, Authenticate, get a mailbox, get the inbox_folder and get a messages collection. Although I'm not done with it I did not get the exception you got. In the meantime, did you make any progress? Aad Slingerland |
Beta Was this translation helpful? Give feedback.
-
I received the same error using similar code. Did you find a resolution? |
Beta Was this translation helpful? Give feedback.
-
This is already fixed in last version released |
Beta Was this translation helpful? Give feedback.
-
Greetings,
I'm apparently connecting to Exchange (O365).
I'm using credentials to authenticate.
account = Account(credentials, auth_flow_type='credentials', tenant_id='MY_TENANT_ID')
if account.authenticate():
logger.log_text('Account authenticated!', severity='INFO')
logger.log_text('Authenticated?:' + str(account.is_authenticated))
It says I'm authenticated - i.e., all the code up to this point works.
Then I get the mailbox:
mailbox = account.mailbox(resource='MY_RESOURCE_NAME')
logger.log_text('Got the mailbox.', severity='INFO')
logger.log_text('The mailbox object type: ' + str(type(mailbox)), severity='INFO')
This also works. Then I get the inbox folder:
inbox_folder = mailbox.inbox_folder()
logger.log_text('Got the inbox folder, apparently - its type: ' + str(type(inbox_folder)), severity='INFO')
Again, this all works. But if I attempt to do anything (i.e., call any function) on the inbox_folder object:
messages = inbox_folder.get_messages()
I get 'str' object has no attribute 'get'. Here's the log, showing each step.
Account authenticated!
Authenticated?:True
Got the mailbox.
The mailbox object type: <class 'O365.mailbox.MailBox'>
Got the inbox folder, apparently - its type: <class 'O365.mailbox.Folder'>
'str' object has no attribute 'get'
Any thoughts?
Thanks.
Frank.
Beta Was this translation helpful? Give feedback.
All reactions