Read emails from outlook received on “current date”


#1

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).


How to filter messages in Get outlook mail messages
Not able to Filter the email received today
#2

Please try this

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


#3

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.


#4

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.


#5

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


#6

@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'"


Regarding Outlook
#7

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.


#8

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


#9

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)


How to filter messages in Get outlook mail messages
Get the date of an email send to me in outlook
#10

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?


#11

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


#13

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


#14

What do you mean by filter by number of emails?

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


#15

It’s a job I was asked for

1@1 ???


#16

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

[From]=‘Uipath Helpdesk’


#17

You can give me a example

email address = example@example.com

time = 2 day

number email= 5


#18

Check the display name of Email and use that

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


#19

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.


#20

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

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

Regards
RaviDevaraj


#21

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