How to open an unread outlook email and click on the link provided

For a project I am trying to have my bot pull reports from a website. I was able to accomplish that. Once the report is generated it is emailed and I need the bot to open that unread email and then click on the specific link in the body of the email. What steps would I take in accomplishing this? Thanks for the help!

1 Like

Hey @RPALearner_17

You need to use get mail activity and fetch the link using email body property

Then pass the link saved in a variable into an Open Browser activity which will open the link in browser for further automation actions.

Thanks
#nK

Hi @RPALearner_17

As @Nithinkrishna suggested kindly go with the approach

But make sure in get mail activity properties you check

Unread mails only

Thanks

1 Like

To get the email body property, would I use for each activity and write a line of the body?

1 Like

Hi @RPALearner_17

use ForEach loop to iterate one by one mail.

   ForEach item in mailMessages
       mailBody = item.Body.Tostring
1 Like

For that it only provides a string, I would need the bot to read the body of the email and select the second URL link. How would I accomplish this?

1 Like

Hey @RPALearner_17

Did that string has the link you need ?

Thanks
#nK

So is it present in that string variable @RPALearner_17

If so we can achieve using regex

Check out the below link for your reference