Do you use the right username password? Don't now for sure, but i think you have to use something like useremail\sharemailboxemail and users password.
Otherwise you can use Microsoft Graph. But this is a different implementatie of using o365 mailboxes. There are some modules for this in the appstore.