Mail Message - Read body without html tags



Hello all,

I’m trying to read mails from gmail which is successful. However, when trying to read body of email using mail.Body as string, i see the body contains HTML tags. Is there a way to read email body as plain text?



I had a similar issue when sending emails and reading them again for an automation.
As I had control over the sending process here, I could use the “Format Text” option in outlook to turn off HTML formatting, when composing a message. This helps to receive the message in plain text format which can be read by UiPath.
Do you have control over the sending process here?.
There is another post in the forum which deals with HTML formatting - isBodyHtml not working as expected.
Please check if it provides any hints to you.


Hi I am thinking the same thing… I am reading email messages with IMAP, and the mailmessages are written in html. What is the best way to parse html so that the only thing left is the plain text?


@trixy, Not sure if this is an best way to do. But atleast will give a try with this :smile:


Dom :slight_smile:

Writing the text after converting the html into the text form

Hi, thanks :slight_smile:
This is what works for html in string format. (import system.text.regularexpressions)


Hi Trixy ,

what are you wrote that code is I tried but it is not working. it is showing with Html Tags.

Any one Provide answer


Did you find a way to read mail body as plain text ?
I am also facing this issue.


Anyone able to resolve this issue. I am facing the same.