Outlook mails

Hi friends,

I have a doubt please help me.

I need save the mails from Outlook which come in between 1 hour like if trigger the bot at 9am i need all the mails from 8am to 9am.

The date in my outlook is like day and time format like Thu 11:23.

In the get outlook message in the filter column I have given
[ReceivedTime]>= startdatetime.tostring(“MM/dd/yyyy HH:mm”) +And [ReceivedTime]>= enddatetime.tostring(“MM/dd/yyyy HH:mm”)

But output of get outlook mail message is coming as null.

Please help me

Hi @0bb4628e217fd43ac86ac9294

Can you try below

"[ReceivedTime] >= '" + StartTime.ToString("MM/dd/yyyy HH:mm") + "' AND [ReceivedTime] <= '" + EndTime.ToString("MM/dd/yyyy HH:mm") + "'"

Regards,

@lrtetala Thank you for your quick response but i tried the same but count is coming as 0 and The date in my outlook is like day and time format like Thu 11:23.

@0bb4628e217fd43ac86ac9294

Use below Linq Query

filteredEmails = allEmails.Where(Function(mail) mail.Headers("Date").Contains(startDatetime.ToString("ddd HH:mm")) OrElse mail.Headers("Date").Contains(endDatetime.ToString("ddd HH:mm"))).ToList()

Regards,

@0bb4628e217fd43ac86ac9294

try this with tt included

"[ReceivedTime] >= '" + Now.addhours(-1).ToString("MM/dd/yyyy hh:mm tt") + "' AND [ReceivedTime] <= '" + Now.ToString("MM/dd/yyyy hh:mm tt") + "'"

cheers