Get outlook mail messages after a certain datetime

outlook
#1

If you dont need background information, just go straight to the question at the bottom.
I am working on a project. The project includes email reading process on hourly basis.
Currently, I simply read all emails and mark them as read. But when my robot throw exception and crashes, it can not re-process those emails I read since it is marked as read. I have to manually select and mark those emails as unread again in order to re-process them.
After that I decide to not mark emails as read at beginning of my process. I simply read emails at beginning and at the end of my process I read emails again to mark as read. But this cause another interesting problem: If I receive emails after robot starts & before robot ends, I will falsely mark the unprocessed email data as read as well.

[QUESTION:]
I want to find an approach to read emails sent within a certain time interval (09:30-10:30, etc).
Or read emails after a certain datetime(after 09:30, etc).
Or simply find a way to mark emails as read emails, not in “Get Outlook Mail Messages” activity, but within the for each loop of email list I got from “Get Outlook Mail Messages” activity.
There must be a way to achieve my goal… If my demand confuse you, please go through background info.

Thank you all.

0 Likes

#2

Hello!

You can use the Filter Property to try to achieve your goal :slight_smile:

Refer to these:

Hope it Helps :slight_smile:

Regards,

1 Like

#3

@eb978xz
If you want to read emails based on Datetime you can use below in filter property

“[Received]>= '” + now.AddDays(0).ToString(“D”) + “’”
“[From]= ‘Input Mail’”

0 Likes

#4

now.AddDays(0).ToString(“D”) is only considering date part, time is not being considered, do we have any solution for that?

0 Likes

#5

I have to get mail (from Sent Items folder) based on Sent time in Get Outlook activity and the Outlook Language: language was in German.

kindly share the Filter syntax to get the mail based on sent time.

Thanks,
Tharma KS

0 Likes

#6

Hey… thanks for the answer… any clue why it wouldn’t work without addDays(0) as logically we are not adding any days so this part is redundant…

Also we were using the format today.tostring(“MM/dd/yyyy hh.mm yy”) which was working since last 3 months in ‘Get Outlook Mail Messages’ filter but suddenly it stopped working… anyone else has experienced this?

0 Likes