Fetch specific Outlook mail

Hello Team,
I have 100 mails in my outlook with same subject line,I have to fetch 96,97,99th mail and display its body,Please guide

Hi
This can be done
Hope these steps would help you resolve this
—use a GET OUTLOOK MAIL activity or any mail activity and get the output with a variable of if list of mailmessage named list_mails
—along that mail activity property,
disable onlyunreadmessage and mark as read property and mention the TOP property as 100
—so that all the first 100 mails will be fetched

-now use a FOR EACH loop and pass the above variable list_mails as input and change the type argument as System.Net.Mail.MailMessage

—NOW use a IF condition like this
list_mails.IndexOf(item).Equals(96) OR list_mails.IndexOf(item).Equals(97) OR list_mails.IndexOf(item).Equals(99)

If true it will go to THEN part where we ca get the details of those mail item or goes to ELSE part

Next to this IF condition use a assign activity like this
count = count + 1
Where count is variable of type int32 with default value as 0 defined in the variable panel

Cheers @Mayyur

Thank you

1 Like

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