How can I use the outlook filter option to exclude multiple emails?
I am using “ExcludeMail” as array
“[senderemailaddress] <> '”+in_ExcludeMail+“'”
How can I use the outlook filter option to exclude multiple emails?
I am using “ExcludeMail” as array
“[senderemailaddress] <> '”+in_ExcludeMail+“'”
@Julian_Claessen Can you use this in an Assign Statement and check if it Works :
msgs = msgs.Where(Function(x)ExcludeMail.Any(Function(y)x.Sender.ToString.Contains(y.ToString))).ToList
Where ExcludeMail is an Array of String that contains mail addresses, and msgs is the Output Of Get Mail Messages Activity i.e List (Of MailMessage)
@Julian_Claessen I think you need to use InboxMails variable instead of msgs variable . The Order is right but make sure you use exclude variable in the expression that i have given instead of ExcludeMail
It works but it only selects the mails mentioned in the exclude array, which need to be the opposite way around
Eg:
Exclude: {“abc@gmail.com”, “def@gmail.com”}
InboxMail: {“aaa@gmail.com”, “abc@gmail.com”, “bbb@gmail.com”, “def@gmail.com”}
Results should be mails only from : aaa@gmail.com and bbb@gmail.com
@Julian_Claessen Oh Yes. I forgot you need to exclude the mails There is a NOT operator missing, try below expression :
InboxMails = InboxMails.Where(Function(x)Not(exclude.Any(Function(y)x.Sender.ToString.Contains(y.ToString)))).ToList
It works! Thanks
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.