Q:

How to clean parse HTML code to string

I need to parse html code into string, because i'm later using it as my body content of email message:
Is there a way to parse html code like this:
<div class="alert alert-success" role="alert">
    <h4 class="alert-heading">Well done!</h4>
    <p>You have successfully subscribed!</p>
    <hr>
    <p class="mb-0">We will be sending you newsletter on weekly basis.</p>
</div>

into string in a clean way, without doing it like this:
string body = @"<div class=""alert alert-success"" role=""alert"">" + "</div>"

so i could pass it to mail like this:
MailMessage mailMessage = new MailMessage();
mailMessage.Body = body;

instead of having a whole series of html code inside string there.
Is there maybe any other "way" to make "design" for email messages?
PS: i also do not want to load html from external file
I would like to use html code to have a decent design for subscribing to newsletter message on email.
Thank you!

A:

/*
If they are static and don't need to be read from a file, as you've indicated, I would create a project->property->resource string for each message.  You can paste the email body into a string variable and then just access it like this:
*/
string body = MyNamespace.Properties.Resources.emailBody1;
/* the string will be formatted with all the quotes and \r\n just as it was from what you pasted in. */
// you could even add some substitution to customize the email
body.Replace("{EmailRecipient}", strEmailRecipient);

