Get Outlook Mail Filtering

outlook

#1

I wanna know the filtering syntax and the limitation of the “Get Outlook Mail Message” activity.

Firstly, I tried to extract my outlook mails without filtering and use the syntax (MailMessage(0).from.ToString) to extract the sender info and the sender info I get is the following: “UiPath Help Desk” support@uipath.zendesk.com

  • Then I try to add a filter with the syntax of “[From]=’“UiPath Help Desk” support@uipath.zendesk.com’”. There is an error of .

but the It works fine with the filter of “[From]=‘Uipath Help Desk’”. May I konw the reason for the error?

  • Also, is it possible to make the filter more dynamic, like "[From]=’“UiPath Help *”.

#2

Yes of course it is possible. Fetch the “FROM” string in a variable(ex:str_FromName) and check whether str_FromName.contains(“Uipath Help”).
Check and let me know whether it suits to your requirements…
Thanks,
Happy Automation.
Jiban


#3

What do you mean by Fetching the “FROM” string?


#4

You can try this

Thanks,
Jiban


#5

Hi @karlkong,
Just put this in your filter of Get outlook email message.
"@SQL="“http://schemas.microsoft.com/mapi/proptag/0x0037001f”" like ‘%UiPath Help%’"

Try it out and let me know.

Thanks,
Avi


#6

image

When I was trying your solution, I got this error.

What is going wrong?


#8

@karlkong Could you try and change the TypeArgument to MailMessage in the properties for the foreach activity. See if that works.


#9

Yes. I’m trying to use the filter function of the get outlook message.

But I wanna know why I can’t get anything by using this syntax. “[From]=’“UiPath Help Desk” support@uipath.zendesk.com’"


#10

HI @Avi7,
I try to find out more about your method, but i have real Problems to understand it.

Here is my issue:
I want to filter a Postbox for a specific email adress - prefix (@something.com).
I cannot use From, because it only works with what it sees aparently.
Example:
[FROM]=‘Miller Peter’ works
[FROM]=‘peter.miller@example.com’ does not work

[senderemailaddress]=‘peter.miller@example.com’ works
but how do i do
[senderemailaddress]=’*@example.com’?

If i copy your example and adapt it,so it might work i got an error.

Example:
“@SQL=”“http://schemas.microsoft.com/mapi/proptag/0x39FE001F”" like ‘%@example.com%’"
Error:
Get Mail Failed, Reason: Cannot parse condition. Error at “@SQL=(('http://schemas.microsoft.com/map…”.

So you i would really be happy, if you could explain how i can filter for a specific mail-ending-Thing(*@example.com).
Because I cannot find much on that matter.


#11

I did solve my own issue by adjusting the Code, but it only works for external mails though, but that must suffice. its only half pleasent for testing purposes.

I hope someone is learning something from my experience and discription, so here are my different Statements and what i learned:
From Statement:
“[FROM]=‘Mustermann Max’”
Sender Email Adress Statement:
“[senderemailaddress]=‘emails@testinfo.com’”
Sender Email Adress with Wildcards
“@SQL=” & Chr(34) & “http://schemas.microsoft.com/mapi/proptag/0x0065001f” & Chr(34) & " LIKE ‘%@testinfo.com’"