How to put a filter condition for more than 2 senders in outlook

Hello,

In my automation .I have to read the emails only if the senders are specified designed persons(sender 1 = abc@gmail.com sender 2 = xyz@gmail.com sender 3 = mnb@gmail.com).How do i do that?

2 Likes

Read Outlook Mail Messages.
For each Mail in MailMessages:
if(mail.sender.from.tostring="abc@gmail.com")
then { Statements}

Hope this helps

Fine in the filter property of get outlook mail activity kindly use this expression
“[SenderEmailAddress] = ‘abc@gmail.com’ OR [SenderEmailAddress] = ‘xyz@gmail.com’ OR
[SenderEmailAddress] = ‘mnt@gmail.com’ “

Hope this would help you
Kindly try this and let know for any queries or clarification
Cheers @cheersrpa

1 Like

Hey …Can you please help me with the sample .xaml file.Because i got the error message like filter condition is not valid

I hope it must be type mistake
Try with senderemailaddress instead SenserEmailAddress

Cheers @cheersrpa

nope…still its not working

“[senderemailaddress] = ‘abc@gmail.com’ or [senderemailaddress] =‘xyz@gmail.com’”

When i use the above syntax it showing as the condition is wrong

Try this,Hope you will get
“[SenderEmailAddress] = ‘abc@gmail.com’ or [SenderEmailAddress] =‘xyz@gmail.com’”

1 Like

When i use the above syntax the mail count is zero.But actually there are some emails with the specified senders in outlook

@cheersrpa
Do you want to read all the emails and then filter (sender 1 = abc@gmail.com sender 2 = xyz@gmail.com sender 3 = mnb@gmail.com).
In that situation, you can try this.
->Read all the unread emails.
→ use for each activity and change the variable type to “System.net.mail.mailmessage”
->then use “If” Condition item.from.tostring.contains(“abc@gmail.com”) for multiple emails you can use OR condtion.

make sure that you have checked the unread mail in properities

as there no ‘mark check’, just wanted to say this actually worked for me. :slight_smile:

only difference was my outlook is in french so it is:

“[De] = ‘abc@gmail.com’ OR [De] = ‘xyz@gmail.com’”

1 Like

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