How to filter for today mail only in Outlook mail message in if condition

Hi everyone, I need expression to get only today’s mail in if condition, suggest a expression. It would resolve my problem

Hi @Gopi_Krishna1

Check the below thread

This will filter the mails that you have received today.

Regards

@Gopi_Krishna1

try this

inside loop Cdate(currentitem.Date) = Today

if linq then mails.Where(function(x) Cdate(x.Date) = Today)

if in filter in outlook activity then

"[ReceivedTime] >= '" + DateTime.Today.ToString("dd") + " 00:00AM'"

cheers

@Gopi_Krishna1,

Use this in If Condition while iterating.

Cdate(currentMailMessage.Headers.Item("Date")).Date = DateTime.Now.Date

Thanks,
Ashok :slight_smile:

1 Like

Hi @Gopi_Krishna1

Try this:


CDATE(currentMailMessage.Headers.Item("Date")).ToShortDateString.Equals(DateTime.Now.ToShortDateString)


Hope it’ll helps you :slight_smile:
Cheers!!

It’s working great :smiley::+1:

1 Like

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