Get Outlook Mail message fails sometimes

Hi Team,

I am facing an issue with Get outlook mail message activity. I am trying to fetch mails from a specified folder which is present in Outlook. Bot throws error as Specified folder does not exist even-though it is present.

The issue here to check :- This error is thrown only sometimes and not everytime. In the Debug mode, if the error throws, i clicked on retry. It retires the same get outlook mail messages activity and it can fetch mails. I tried by keeping the outlook open and also closed. But the issue is not resolved.
Please help me with suggestions.


Hi @soorya_prasad

Are you want to read “inbox” folder or passing some other folder?

@Gokul001 , I am reading different folder. It is reading mails properly most of the time. Only sometimes, this error comes


Check the settings

  1. Pass the account name in “Account” attribute and just the folder name in the “MailFolder” attribute
  2. Which folder are you trying to read? Are you able to see/open the same folder manually under the [robot] account?
  3. Provide a folder path in correct format: - folder\subfolder

Can you tell the Foldername?

Hi @Gokul001 , PFA screenshoots attached. That’s my outlook account folders. All the 4 unread mail folders are in use. Bot throws error for all of these 4 folders. I have also attached the UiPath properties for one of the Folders


  • In Properties → MailFolder → Deleted items\Delivery approval

@Gokul001 , that contains a test folder which is deleted. The 4 process folders are not coming under that Deleted Items.

In this What you want? Make it clear

Hi @Gokul001 ,

I need to fetch emails from the “Delivery Approval” folder from the Mail account(Striked out). This folder is same as Inbox folder.(Not a sub folder).


  • In Properties → Mail Folder → Mail_id\Delivery approval

Use a Retry Scope.

This suggests your code is fine and Outlook is just not available sometimes. Maybe the on-premise-server doesn’t have the best availability? It happens!

As said before: Use Retry Scope and add a couple of seconds as RetryInterval (TimeSpan.FromSeconds(10) for example)

Hi @lukasziebold

Retry scope activity needs conditional activity. How can i use it for Get outlook mail messages activity? Please suggest me if any other external package is needed.

Retry Scope doesn’t need a conditional Activity. Leave it blank and it’ll retry as long as an error happens (up to the retry limit you set in its properties).

1 Like

try this:

  1. Open Outlook as an Admin
  2. Click File
  3. Options
  4. Trust Center (bottom left-side menu)
  5. Trust Center Settings
  6. Programmatic Access
  7. Click “Never Warn Me About Suspicious Activity”
  8. Save

It also helps if Outlook is open as well. You can use Invoke Code for this code: System.Diagnostics.Process.Start(“outlook”)

Or you can just use the Start Process activity.

correct, but that avoids directory paths

Hi @postwick ,

The retry scope activity is working properly for my use case. Thank you for the solution

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.