Mark outlook mail item as Read or Unread using UiPath
A lot of times while working with outlook automation we want to mark a mail item as read or unread because of business requirements.
But this feature is not available in previous versions of the mail activity package.
The recent update has all these awesome features for outlook automation and this is one among them.
Let’s get into the practical implementation part using UiPath.
Step1: Firstly update the mail activities package to the latest version that is shown below:
Click on update and click save.
Now you are able to see the updated activities in the activity panel.
Step2: Drag and Drop a Get Outlook Mail Message Activity from the activities panel as shown below:
Step3: As the above activity will get all the mails that are unread and marks them as read.
So if you want to mark them as unread after reading it then the below step will show that.
Step4: Drag and Drop a For Each Activity and also the Mark Outlook Mail As Read/Unread Activity from the Activities panel to the designer panel as shown below:
Here we are making the mail item which is read to Unread.
If you want to make a mail item to Unread to read then select the drop-down for Mark as an option to read.
If you face any errors in for each that is probably of Type Argument.
The default Type Argument is an object, change that to System.Net.Mail.MailMessage.
Here it will read or unread all the mail items that are present in mailmessage list.
If you want to make certain mail items as read or unread basing on certain conditions then use some conditional statements.
To sort the required mail item to mark as read or unread basing on subject or sender mail using an if condition.