How do I read embedded links from an email body?

Hey All,

I’m reading the mail body by using “Get Outlook Mail Messages” activity and a “For Each” with assigned values to read from “Approval Type” to “Internal Transfer Subject”.

I have two embedded links in the mail body. How do I read those separately ?

Email Body :-

Dear ABC,

Approval Type - Internal Transfer Request
Purpose Of Transfer - Normal Transfer
Internal Transfer Number - ITRAP-000897525
Date of Submission - 24 June 2023
Originator - ABC
Internal Transfer Subject - From Commercial to Inspection Room

Click on the below link to proceed.

Click here - (search)
Click here - (watch )

Thanks and Regards,


Try reading the htmlbody which will contain the url as well

then use regex on it to get the data



Can you please share a xaml file ?


Please check this on how to get htmlbody…from there you can use regex or split string to get the url

mailbody.xaml (7.3 KB)


Hello @Anil_G ,

Can you please add the method in the below attached project file ?

I don’t understand the method you’ve suggested.

Auto (3.0 KB)


@uio Here’s a XAML you can try. When you have the HTML of the email, this uses the Regex Matches function and results into a Match Collection data type. You can loop through each of the collected URLs:

Text.RegularExpressions.Regex.Matches(strHTML, "(?<=<a href="")(.*?)(?="">)")


Auto (3,4 KB)

Hope this helps!


How do I assign two different variables for the URLs ?

@uio - You can assign like this and access the Items in the Match Collection:

strLink1 = coll_strURLs.Item(0).ToString
strLink2 = coll_strURLs.Item(1).ToString

Auto (3,4 KB)


@argin.lerit Thank you so much for your support.

1 Like

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