How to extract particular subjected mails from list of unread mails?

Hi All,

I have used “Get IMAP Mail Message” Activity to read all unread mails and in Filter Property I have given 2 types of values:

  1. “[Subject] = ‘|’”
  2. mail.Subject.Contains(“|”)

but getting error as shown below.

image

For example: if subject contains “Complaint | 19 15 01178 | New | Hans test”
I need to extract this mail from list of unread mails.

Please help me how to implement this.

Thanks in Advance:-)

Did you read this?
Get IMAP Mail Messages (uipath.com)

Cheers

image

Based on above query , I have given

“SUBJECT “”|”“”

But facing same error.

Personally I do not have experience with IMAP.

I would recommend to test filtering using some common words, like “Complaint”, just to see if it works at all.

Then move to filtering using special characters.

Cheers

Yes, it’s working with Common word. But how to get all type of mails which contains “Incident” or “Service Request” or “Complaint” etc.,

I have given this way in the filter.

“SUBJECT ““Incident””” Or “SUBJECT ““Service Request””” Or “SUBJECT ““Complaint””” Or “SUBJECT ““Security””” Or “SUBJECT ““Question”””

But throwing error “Option strict on disallows implicit conversion from string to long”

1 Like

I suppose it should look like
"OR (SUBJECT ""Incident"") (SUBJECT ""Service Request"") (SUBJECT ""Complaint"")"

Cheers

Yes I’ve tried but error again.

image

or like this?

"OR (SUBJECT Incident) (SUBJECT Service) (SUBJECT Complaint)"

I have no IMAP account to test with :frowning:

Actually I’m using my Gmail account only but passing IMAP Port 993 and server “imap.gmail.com

Well, I tried this but getting error “Get IMAP mail messages: Invalid credentials (Failure)” :frowning:

You need to give app password of Gmail.

Gmail → Manage your google account → Security → App Password → Generate

This will create a random key . You need to copy and paste in Password field.

image

I do not have this option under my google account :frowning:

Have you followed the path properly?
It’s inside Security Page . When you scroll down little bit, you will see

So this works
OR (SUBJECT Incident) (SUBJECT ""Service Request"") (SUBJECT Complaint)

Just not that

  • only one space after OR
  • only one spece after SUBJECT
  • only one between each (SUBJECT *)
  • at least two (SUBJECT *)

Cheers

I’m getting error as “SUBJECT is not declared. It may be inaccesible due to it’s protection level”

It is string so like this indeed…
image

Cheers

is it working for you perfectly ?

Yes indeed. Do you still have problem?

Also check the FIlterExpressionCharSet. I use “US-ASCII”

I have also same problem about this topic but your discussion will help me . thanks a lot