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:
https://forum.uipath.com/t/get-the-date-of-an-email-send-to-me-in-outlook/6745

1 Like

@SIVASHANKAR
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.

3 Likes

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

@SIVASHANKAR
image

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.