Extracting string from body email

Hello friends,
I need to extract the 4 strings located after the words: BUSINESS OPERATIONS (at the end of the email body).

How it it possible to search for 4 the words located in the 4 diffeent lines after the string BUSINESS OPERATIONS?
Thank you so much,
Camilla :slight_smile:

1 Like

Hi! Did you tried using Screen Scraping?

1 Like

Thank you @Niket_Ghai.
I thought It would be more reliable to use the Regex Expressions.
Can you please help me?
Thank you,
Camilla :slight_smile:

That’s true. So are you extracting the whole body and then are you trying to filter out the email?

1 Like

Yes exactly :slight_smile:

1 Like

You can split the body of mail by “BUSINESS OPERATIONS” and take the secord array item.
Again then split by your name and take first array item (if you are the sender always)


screen scrapping is not required read the message body using MailMessage.Body to get entire text to a variable.

hope this is not required. split the second array item by Environment.Newline and take the first four array items if the pattern is same for all the mails.


1 Like

Thank you @pathrudu.
Can you please give me the example of how to extract the first word?
Thank you so much,
Camilla. :slight_smile:

change the folder name change index numbers as per your requirements. hope this may help you.

FetchDataFromMail.xaml (10.2 KB)



Thank you so much @pathrudu.

It works but the output of the first string that should be extracted is empty:

Can you please help me a little bit more?
Thank you so much,
camilla :slight_smile:

There is a new line after Business Operations, so use 2,3,4,5 the items. :slight_smile:


this will work only if the pattern of your mail is fixed else you need to check for length of each item if its zero go for the next item till you got four entities.


Thank you so much @pathruduI ask you a little question.
In case I get the date in the format “ddMMyyyy”, how is it possible to manipulate in order to insert the “/” separator?
Thank you so much.
Camilla :slight_smile:

Main (3).xaml (5.5 KB)
This might help you to change the date :slight_smile: