Grab subject from office 365 email web


I am trying to make the bot pick up a certain subject from a list of daily emails in the inbox and move it to a specific folder, i am doing this by using get text on the subject and then the built in hotkeys o365 has, the hotkeys etc work fine however the get text is in a loop so that it counts the number of emails and knows how many times to loop, each time the bot loops the get text for the subject output is always the one for the first email despite the get text activity being in the loop, can anyone help? I need the get text to refresh so its actually picking up the next subject, screenshot attached

Hi Adeel,

You could try using GetExchangeMailMessages

Then use a loop to get your subject


Then move it


p.s. I’m using a Shared Mailbox in my examples so ignore that

Hey Roy

I would love to use the built in activities for exchange but it looks like this needs to be setup in order to use it?

Or am i wrong?

I don’t think you need to do anything special - should all be there ready to use

I have this installed in Manage Packages


Hmm ok are the settings on the right correct? Im not sure how to test if this function is working

When i run it i get the following error

RemoteException wrapping UiPath.Mail.ExchangeException: The request failed. The remote server returned an error: (405) Method Not Allowed.

Looks correct - It maybe something to do with the userid.
I found this which may help diagnose further

Just had another thought - try putting your email in the autodiscover box instead and remove the Exchange server and Server info


tried as you suggested and got this error
RemoteException wrapping UiPath.Mail.ExchangeException: The Autodiscover service couldn’t be located.

I can only think that this has got something to do with the server end. Are you able to use another O365 email address not related to the current one you are using. I’m using a company email domain so maybe they have configured everything properly at the server end. If this is a personal email address you are using I can only GUESS this is where the problem maybe and you will need to go back to your initial method.

Just seen this on the web - is there a way to try it from a non work machine if that’s what you are using.

possibly i’ll forward this to our sysadmin and see