3
Answers

send html template from windows form

mike Delvotti

mike Delvotti

9y
377
1

Guys,

 I'm trying to change a place holder in an external HTML template then email as a body.

I can get this working fine but I'm struggling to get it to read an external html file from url with streamreader.
 
I'm assuming I would need to use WebRequest instead of streamreader to get the remote html file? 
 
below is my code:
 

           using (StreamReader reader = new StreamReader(http://mytemplate))

            {

                body = reader.ReadToEnd();

            }

            body = body.Replace("{CompanyName}", companynameTextBox.Text);

 
Answers (3)