Read emails from outlook received on “current date”

I have gone through the e-mail Ui Path tutorial video. The example over there shows the emails that are fetched from current time to past 24 hours.but my concern is that i want to fetch the emails only of today’s date(the present day).

Please try this

“[ReceivedTime] >= '”+now.AddDays(-1).ToShortDateString+“’ AND [ReceivedTime] <= '”+now.ToString +“'”


It is giving dates for previous date as well. How can I retrieve all the emails for current date, i.e., suppose I want to get all the mails which I have received only on 04/07/2017(mm/dd/yyyy).

Thanks in advance.

Try this

“[ReceivedTime] >= '”+now.ToShortDateString+“’ AND [ReceivedTime] <= '”+now.AddDays(1).ToString +“'”

this logic applies for today’s, let me try for a specific day. Will let you know, even you play around with it and let me know if you find.

1 Like

I tried this too, but it is not giving any result.

@priya Try this, i’m able to get in Outlook for both. Did you have unread checked?

Today : "[ReceivedTime] >= '"+now.ToShortDateString+"' AND [ReceivedTime] <= '"+now.ToString +"'"

Random Day : "[ReceivedTime] >= '11/01/2016' AND [ReceivedTime] <= '11/01/2016 23:59:59'"


I have tried both way, i.e, for unread mails the unread properties is checked and for read mails the unread properties is unchecked. But still i am not getting any result.

Not sure, please search the forum, may be you can find better solution. Thanks.

Hi @Amarjeet,

I have attached an example that filters the messages according to the date they were sent.

Could you please check it and tell us if it’s what you need?

Main.xaml (8.4 KB)


If i write NOT “[ReceivedTime] >= '”+now.AddDays(-1).toString

Does it work the other way? Ie does not let me read the emails that came in that time?

How about “[ReceivedTime] < '”+now.AddDays(-1).toString

1 Like

If I wanted to filter by the number of emails sent by the same person?

What do you mean by filter by number of emails?

you can try and get the count “[From] AND [ReceivedTime] < '”+now.AddDays(-1).toString"

It’s a job I was asked for

1@1 ???

Its an example for Email Address, you can use the Name of the User

[From]=‘Uipath Helpdesk’

1 Like

You can give me a example

email address =

time = 2 day

number email= 5

Check the display name of Email and use that

“[From]=examplename AND [ReceivedTime] >= '”+now.AddDays(-2).ToShortDateString+“’ AND [ReceivedTime] <= '”+now.ToString +“'”

1 Like

I am simply trying to do what the tutorial video is showing, of retrieving email with a filter of the last 24 hours.

I’m putting

“[ReceivedTime] >= " + Now.AddDays(-1).ToString(“MM/dd/yyyy hh:mm tt”) +”"

into the filter field.

Everything is set up fine and I can get email, download attachments or whatever but none of the filters I’m trying are working. Did I type this wrong? It would be very helpful to have a list of the expressions used in the video, listed in the description on YouTube for self-check and even copy-paste.

Hi @vvaidya @acaciomelo @Amarjeet @dnllorenzetti @priya @CodeForgePro

can anyone get the solution for this issues !!!

while i am using Get Outlook mail Message Activity in that property Mail Folder i have gave command as “Sent Items”
Error : The specified folder not exists.
But in My outlook folder are available : image


For GetOutLookMail Message, I used following filter to get the result (email) for today (.i.e. past midnight until current time of the day)

“[Received] >= '” + now.AddDays(-1).ToString(“D”) + '“”

If you want to get the results for last two days, simply replace -1 with -2.

Hope this helps