The received emails may come from different domains and only a couple of them are to be searched. Therefore, I would like to read an excel sheet with domains to be searched so I need to have a dynamic filter. How is the best way to do this?
Lets say my xls-sheet have three domains: example1.net, example2.com, example3.org. The inbox contains emails from a lot of different domains but I want only filter on these three domains in the xls.
Should I read the excel and create a loop that creates a string to be saved in a variable? Then use the variable in the filter?: “[ReceivedTime]>=’ “+ Now.AddDays(-1).ToString(“yyyy-MM-dd HH:mm”) +”’” AND vVariableWithDomains
Dont know the syntax but something like this within the variable:
vVariableWithDomains = “[From]= *@example1.net OR [From]= *@example2.com OR [From]= *@example3.org”
Any suggestions how to do this?