Get text from mail body

I want to get text from mail body and save it in variable so i can use it further.
What tool i have to use for it ?

@Saud_Ahmad,

U Can Give A Try With Outlook Mail Mail Messages in UiPath Activities Panel.

Once you provide the required details such as mail address , folder name where you want read the emails etc.

Let me know if your still not cleared with the solution.

Regards,
Anil

Hi @Saud_Ahmad,

Use Get Outlook Mail activity to get the mails from OutLook.

  • Then from the GetOutlook Mail Acitivity output List you can loop
  • Assign item.Body to a string variable
  • Extract the specific text using regex/substring then assign it to the variable.

Iam getting what is written in body but i don’t know how to store it in a variable so i can use it further

Using assign activity, Store your Mail Body in variable…and then use string manipulation or regex to extract specific text.

GetOutlookMails.xaml (6.1 KB)

Check this xaml for the same

1 Like

@Saud_Ahmad,

If you want to get the body text in a variable …

Then create a new string variable and assign body text in it like below.

myBodyString = Mail.Body.ToString()

Regards,
Anil

And if i need to save text in 3 other variables ?
Like someone is sending me email and wants me to book a flight for him and he sent me the name of cities where he want to travel and i need to store the names of cities and the date in a variable so i can use it later when iam booking the flight and then replying to the email

@Saud_Ahmad,

Can you provide me the email format along with the details which you want extract so that i can help according to that.

Regards,
Anil

Thank you everyone for the help