How to Get Date time E-mail From headers

Hi,jack.chan

I’m sorry to ask this again. Maybe I’m using the wrong question the first time.
How to Get Date time E-mail From headers

Every day I want to read E-mail 3 times.
The condition, if the subject is the same, must not be repeated.
example

If it’s 9 am now, condition 1 must be met.

If it’s now 2 p.m., condition 2 must be met.

If it’s 6pm now, condition 3 must be met.

condition

  1. From midnight to 9 a.m.
  2. From 9 a.m. 1 minute - 2 p.m.
  3. From 2:00 p.m. 1 minute - 6:00 p.m.

But the code example below will result in combining all 3 codes, it will be possible at any time.
For example, if i work at 2 o’clock in the afternoon, i will receive an e-mail at 9 o’clock in the morning.

please help me again

Thank you

make 3 if statements

midnight → 9am
if Now >= New Date(Now.Year, Now.Month, Now.Day, 0, 0, 0) and Now <= New Date(Now.Year, Now.Month, Now.Day, 9 , 0, 0)
then
filter = "[Received] >= '" + DateTime.Today.ToString("d") + " 00:00AM' AND [Received] <= '"+ DateTime.Today.ToString("d") + " 09:00AM')"

9:01 - 2pm
if Now >= New Date(Now.Year, Now.Month, Now.Day, 9, 1, 0) and Now <= New Date(Now.Year, Now.Month, Now.Day, 14 , 0, 0)
then
filter = "[Received] >= '" + DateTime.Today.ToString("d") + " 00:00AM' AND [Received] <= '"+ DateTime.Today.ToString("d") + " 09:00AM')"

2:01 to 6pm
if Now >= New Date(Now.Year, Now.Month, Now.Day, 14, 1, 0) and Now <= New Date(Now.Year, Now.Month, Now.Day, 18 , 0, 0)
then
filter = "[Received] >= '" + DateTime.Today.ToString("d") + " 02:01PM' AND [Received] <= '"+ DateTime.Today.ToString("d") + " 06:00PM')"
Sequence.xaml (12.6 KB)

1 Like

Thank You For your Support ^^

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.