Read 6000 Mails by "Get outlook mail message"


I want to read 6000 unread mails from Inbox, But I got error,


Please give suggestions.

Thanks in advance…!!

@ClaytonM @palindrome

1 Like

Hi there.
100 emails will take probably 5 mins, so 6000 will take like 5 hours… although I could be wrong. In any case, you will need to set the TimeoutMS property on your Get Outlook Mail Messages so it will wait much longer for that many emails. It will get the TimeoutException if the TimeoutMS is too short.


1 Like

Can I use parallel activity?

1st workflow will read 1-100 mails, 2nd will read 101-200.
Is it possible?

1 Like

You can try parallel, but I don’t think UiPath will move to next activity until the first one is finished. You could try placing the Get Mails inside a separate workflow and Invoke it in parallel, because then it might move to next Invoke.

I’m not sure if it will work though, but worth a try.

You could also try using the Queues in Orchestrator instead.

This won’t speed things up. It is the same computer that does the processing.

So, what is the best solution for this issue? @tdhaene

If you use thé regular activities thé only thing you can do is increase thé time-out like Clayton suggested. I’ll take a look if there is a faster
.Net commando

Please check my flow,
Main.xaml (41.5 KB)
project.json (633 Bytes)

I use parallel activity and timeout is use 100000.

But still got error:- The operation has timeout.

@ClaytonM @tdhaene

and if you do it in a cycle where you can read the unread emails by date range of reception,

I would do it like that :roll_eyes:

You can read the mails by current date.

todayMAIL = mailMESSAGE.Where(Function(x) DateTime.ParseExact(x.Headers(“Date”), “MM/dd/yyyy HH:mm:ss”, Nothing).Date.Equals(datetime.Now.Date))

If I look at your xaml file, I have a idea how you could do this like an online method.
Now you process in groups of for the 100 mails.
Put your check algorithm in a while loop with end condition if the number of readmails (in list of mailmessage: mailMESSAGE) is less then 100 and mark your unread mails as ‘MarkAsread’. Make sure your timeout is long enough to read the group of 100 mails in a row. This way your group will drop from 6000 towards 5900 towards 5800 and so on


Ok, good idea…
I will try that, But can this save the time?

You won’t have the timeout,but I’m afraid you won’t save time

Ok, I will try… Thanks for suggestions.