mike Delvotti

mike Delvotti

  • NA
  • 262
  • 0

send html template from windows form

Sep 24 2015 1:04 PM

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)