Mark Mail As Read Only After A Condition is Fulfilled

I am creating an automation to read all the unread mails, and check them if they contains any word “some keywords” in the body or subject, and then copy the body in a text file.

I want then, only if “some keywords” is found (hence the message content is copied to a text file), I want the mail is marked as read. (This makes Get IMAP Mail Message with Mark As Read checked is improper). Anyone know how to do this?

Notes: I am using IMAP in this mail processing.

Have you found any solution for this…??

@Divyashreem I wish I had, but not, not yet.

i am also looking out for a solution

1 Like

@lawanyaram @Divyashreem @whyyouandi Hey guys have you come across any solution for this?


@Joshikumarav Have you got solution?

we created the customer activity for this

customer activity? Could you share the overall idea?

@indra I did a lot of readup. But UiPath doesn’t allow any capability to do this. The System.Net.Mail.MailMessage that UiPath uses to read message doesn’t have an Unread property to set back to false.

The approach i used is as below. Not the best. But does the purpose. So the idea is, we are already in the for each loop. so we only have that item. Once all my conditions are met, I move it to a different folder (still unread) and now I use get outlook mail activity again, move the message back to the inbox and mark it read. I felt this was effective than calling vb scripts for outlook process.

But i am open to improve the process if people have other views.


You can use the below outlook filter for filtering the specific criteria, We are using filter to get email only with in 12pm like below,

“@SQL=” + “”"" + “urn:schemas:httpmail:datereceived” +“”"" +" <= " + “’”+Date.Now.Date.ToString(“MM/dd/yyyy 12:00 PM”)+”’"

Hey guys have any of you found any solution for this. i am stuck with similar issue.

Hi ,
Did you get any solution for this ? i am also stuck with the same problem.