title: MailMessage.Body loses CrLf with Encoding.UTF8
body: <p>I had an interesting bug today when sending plain text emails from our system.  We format messages like this:</p>
  
  <p>-1st something happened blab bla.<br>
  -2nd something else happened blab blab blaa bla.<br></p>
  
  <p>Today we had an email that looked like this:</p>
  
  <p>-1st something happened blab bla.<br>
  -2nd something else happened blab blab blaa bla $1000.00 -3rd Something happened.<br></p>
  
  <p>So above, we see that we lost the CrLf but only on the message that didn't have a period and ended in 0.  I went through the code and found the CrLf is intack up until we send the email.  I tracked the code down below, I am guessing it applies to C# as well:<br></p>
  
  <p><em>NOTE</em>: We use <code>Environment.NewLine</code> when building the string for the body.<br></p>
  
  <p><strong>Building the string:</strong></p>
  
  <pre><code>If Not errorList Is Nothing Then
      If errorList.Count &gt; 0 Then
          strBldrBody.Append(EMailHelper.CrLf)
          strBldrBody.Append(EMailHelper.CrLf)
          strBldrBody.Append("Response Error List:")
          For Each itm As String In errorList
           strBldrBody.Append(EMailHelper.CrLf)
           strBldrBody.Append(DataHelper.DASH)
           strBldrBody.Append(itm)
          Next
      End If
  End If
  </code></pre>
  
  <p><strong>Email encoding setting:</strong></p>
  
  <pre><code>Try
      If Not String.IsNullOrEmpty(recipient) Then
          Using mailMsg As MailMessage = New MailMessage()
  
              mailMsg.From = New MailAddress(_configHelper.EmailFrom)
              mailMsg.Subject = subject
              mailMsg.Body = body
              mailMsg.BodyEncoding = Encoding.UTF8
  
              EMailHelper.SetToAddress(recipient, mailMsg)   
  
              Dim smtpClient As SmtpClient = New SmtpClient(_configHelper.EmailRelayServer)
  
              smtpClient.Send(mailMsg)
          End Using
      End If
  
  Catch ex As System.Exception
      'logs error
  End Try
  </code></pre>
  
  <p>I want to know what happened in the string translation during the UTF-8 encoding/decoding that removes the CrLf?!</p>
  
  <p>The problem was Outlook, see below:
  <a href="http://i.stack.imgur.com/PCGJa.png" rel="nofollow">outlook screen shot</a></p>