How to retrive IMAP mail messages filtered those mail have only attachments by using get imap mail message activity?

What should be the filter expression, so that we only read those mails which has attachment.
Like we have Subject and date filters are available to retrive the mail messages at tha time of reading the mail box.

Hi,

Use “HASATTACH” in filter property.

no, its not working.

Hi,

Read all the mails.

Then pass your maillist in below assign activity

Assign activity:
FilteredEmails = (From email In mailList
Where email.Attachments.Any()
Select email).ToList()

If this solution works for you. Please mark this as a solution, so others can refer the same. :slight_smile:

Hi @Jayesh_678
Thanks for your suggestion.
but actually I have more than 3lakh mails in the Inbox, so to read this number of mail is not worth it. Thats why I am looking into the filter expression so that I will get only the required one.

@Amiya_Bhusan_Sahoo,

In Get IMAP Mail Messages Activity FilterExpression property, pass "hasattachments:true" as string

Thanks,
Ashok :slight_smile:

Getting this error:
Get IMAP Mail Messages: The IMAP server replied to the ‘SEARCH’ command with a ‘BAD’ response: Could not parse command