Extracting Email Information - Exchange Scope

I am trying to extract different variables from multiple emails using the Exchange Scope activities.

I am pulling the top 5 results based on the subject filter.
From here I need to:

  • Read the subject lines on the results and move email data into different datatables based on country IDs in subject
  • Read the email body and pull out a URL which exists (emails are structured and all the same)
  • Launch URL to download the relevant file

I can find results for the 365 activities but am struggling with the exchange scope.

Hi @elliot.barling

Can you please try using regex if your emails are in same structure

Dim urlPat As String = “https?://[^\s]+”
Dim match As Match = Regex.Match(mail.Body, urlPat)
If match.Success Then
extractedUrl = match.Value
End If

If you found your respective url you can pull it through the subject or context you are looking for.
Hope this solution helps

@elliot.barling

When you say struggling with exchange scope may I know what exact issue you are facing?

Cheers

Hi @elliot.barling

You would iterate the extracted MailMessages in a For Each activity to do the required actions.

To move the mails into datatables you could use a Switch or If activity to check for which contry ID is present.
And then Add Data Row to actually add the mail to the datatable.

If currentMailMessage.Contains("US")

After this you could use the built-in activity Find Matching Patterns to extract the URL from the body.
The Configure Regular Expressions wizard contains a default pattern for URLs.

Then you would use a Use Application/Browser container and a Go To URL activity to actually open and navigate to the URL.

Download example: MailMessages.xaml (18.7 KB)

Regards
Soren

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