Not finding Email Subject, Body inside For each UiPath
While dealing with outlook automation we generally come across this error.
But it is not really an error.
You just need to change the TypeArgument in the For Each Loop to iterate through each mail item and get the email subject, email body.
How to change the TypeArgument in For Each?
Follow the below steps to achieve this:
Firstly, go to properties panel of For Each like below:
Here you can see the TypeArgument is Object but that needs to be System.Net.Mail.MailMessage.
Go to Browse for Types and type System.Net.Mail.MailMessage :
Select this and now you can find the email subject, email body inside for each loop for each mail item.
That’s it for this post on how to get the email body, email subject of each mail item while performing outlook automation.