title: SmtpClient sending raw Html
body: <p>Could anyone tell me why the following code is sending out emails in raw Html? As in, the email looks like when you view a page source.</p>
  
  <p>I have cut down the code so as not to include attachments and from addresses.</p>
  
  <p>If I disable the line with the alternate view the email renders correctly but I also want to send out a plain text version.   </p>
  
  <pre><code>using (SmtpClient client = GetSmtpClient(settings)) {
      using (MailMessage message = new MailMessage()) {
          message.IsBodyHtml = true;
          message.BodyEncoding = System.Text.Encoding.GetEncoding("iso-8859-1");
          message.To.Add(toList);
          message.Subject = subject;
          message.Body = htmlTemplate;
          message.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(textTemplate, new ContentType("text/plain")));
          client.Send(message);
       }
  }
  </code></pre>
  
  <p><strong>Edit</strong>: The message was originally sending text as the main body and html as the alternative view but I have run into a problem with accented and foreign characters as described <a href="https://stackoverflow.com/questions/12374211/accented-characters-not-showing-up">here</a> and wanted to set <code>IsBodyHtml</code> to true, which forces me to set html to the main view.</p>