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.

@santhoshi

Welcome to the uipath community.

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

Hi
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.
HOW???

Hi
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) )
    message.IsRead=False
    message.Update(ConflictResolutionMode.AutoResolve)

  • Provide exchangeService and Email id as Arguments

1 Like

What is this exchangeService?

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

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,
Navneet
Happy Automation! :slight_smile: