How to mark email as unread after doing some process

I am trying to Read emails using read email activity and do some process then marking that email back to unread. i am not find any ways to make it unread at the end of my process. I have tried invoke code activity(mailmessage.UnRead–> It seems, the “mail message” type doesn’t have the unread property) as suggested in few topics. But it did not work. Pls suggest what would work.

1 Like

did you try short cut key : citrl + U

Hi @santhoshi

you can uncheck “MarkAsRead”. In that way the email will be unread even you read it.


Welcome to the uipath community.

Use Get Outlook Mail Message activity to read the mails and uncheck MarkAsUnread option.

welcome to uipath community
May i know why do we need to mark it as read
in any mail activity along the property panel, disable MARKASREAD, so that it wont get marked as read even though if it is fetched

or do you want to mark them as read and then unread
if so did this thread help you on that

Cheers @santhoshi

))))))) I read byexample all UNREAD message ( robot i mean). I work with all this messages and check - is it MINE ??? YES - i work with this message , if it is not MINE - i have to let it as UNREAD in mailbox!!! If i use GETOutlookMail Activity - ALL these message getting market as READ. That is not what i need.

I was also searching for a solution to mark the Mail as unread after doing some process.
Here is my solution:

  • Use InvokeCode activity with the following code inside Exchange Scope
    Dim message As EmailMessage= EmailMessage.Bind(exchangeService,id, New PropertySet(BasePropertySet.FirstClassProperties, EmailMessageSchema.IsRead) )

  • Provide exchangeService and Email id as Arguments

1 Like

What is this exchangeService?

exchangeService is an input argument of type Microsoft.Exchange.WebServices.Data.ExchangeService

Hey @indiraprakash,

Just wanted to know how to update code to filter specific subject, however I implemented this with other workaround along with your provided solution :slight_smile:

Thanks & Regards,
Happy Automation! :slight_smile:


I’m trying to use your solution to set the mail as unread but I’m getting error on the invoke code.

I’m getting the error "Exception has been thrown by the target of an invocation.

I’m using this inside the Exchange Scope and all the arguments are with the correct values, so I can’t seem to find what’s wrong with it.

For checking, the" id"is in the code is the Message-ID we get for example from the Headers os the email. Right?


Could you please try it with “UID”

Did you find any solution? I am working with same query, I want to unread messages by comparing something on Excel file. How should I achieve this?

Depends on what are you using to handle emails.

It is easily possible using the outlook activities

I am using outlook activities but how should I achieve mark as unread?

Yes then you can go to activities panel and select the filter icon on top, and check the “Show Studio X”

Also, will be appreciated to stick to one thread, ee reply tu the other thread.

Thanks for understanding.

1 Like