Hi all, I need a expression to read only yesterday mail in if condition, suggest a method to implement it.
Thanks in advance
Same like this,
just change the condition to this.
Cdate(currentMailMessage.Headers.Item("Date")).Date = DateTime.Now.AddDays(-1).Date
Thanks,
Ashok
Instead of using the If condition you can directly filter the yesterday mails by giving the below filter expression in filter option in Mail Activity properties.
Check the below filter option to filter the yesterday Mails,
"[Received] >= '" + DateTime.Today.AddDays(-1).ToString("d") + " 00:00AM' AND [Received] < '"+ DateTime.Today.ToString("d") + " 00:00AM'"
Hope it helps!!
1 Like