How to filter recent outlook mail

How to fetch outlook mail which is received in last 5 minutes.

You can get out of the MailMessage the datetime on which it arrives.
So you can filter mails by it.

You can refer to this:

1 Like

You can use Outlook distinct feature.
Set Filter at the Get Outlook Messages activity :
“[ReceivedTime] > '”+ DateTime.Now.AddMinutes(-5).ToString(“MM/dd/yyy hh:mm”)+"’"

Make sure you adjust the Day Time string format.


from where we can get the specified format

when i tried the same syntax

“[ReceivedTime] > '”+ DateTime.Now.AddMinutes(-2).ToString(“MM/dd/yyy hh:mm”)+"’"

it is throwing the below error messageCapture


Did you copy and paste the code the Properties Filter ?
Copy and paste the code need to retype the single quote.

And make sure that the Date Time format string is adjusted as your environment used.