Make read email unread

Good evening,

i am reading a few unread emails from the outlook and marking them as read and using those mailmessage properties in the code. sometimes after reading the emails, bot stops. but when I close the outlook and open outlook again and make those mail unread and run the bot again it is working fine.
i have kept the getoutlook in try catch and in catch i am closing the outlook and opening outlook again. now the problem I am facing is " How to make those already read emails unread".

can anyone give an idea to face this issue.

Read the outlook mail message without setting the property “mark as read”.
Once the bot successfully completes the mail message, then set it to mark as read.

I didn’t tried. Please check -

Invoke Code Activity - mailMessageObject.UnRead = false

2 Likes

thanks. i will try and let you know.

Hi Sathwik,

i have the same kind of requirement ,is that is working for you by using the invoke code activity

Yes it works. i don’t know about invoke code activity. but before entering into the main flow. i read all the emails but just keeping them unread, and i tried to access anyone of the elements like mail.body. if it works then i am making all the unread emails read else closing the outlook and relaunching it and repeat the same until it works.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.