title: Why does StringBuilder.AppendLine not add a new line with some strings?
body: <p>I'm trying to use stringbuilder to create a body of string to be used in a text (not HTML) email. However some lines (where i include dynamic data, a new line is not added, but in some the newline works as intended.</p>
  
  <p>Is there something basic i'm missing when using the stringbuilder class or is there some more fundamental process that should be happening?</p>
  
  <p>in the below code:</p>
  
  <pre><code>sbUser.AppendLine("Please find below confirmation of your registration details. If any of these details are incorrect, please email someone@somewhere.com");
  sbUser.AppendLine();
  sbUser.AppendLine("Selected event : " + ContentPage.FetchByID(int.Parse(ddlEvent.SelectedValue)).PageTitle); 
  sbUser.AppendLine("Date of event : " + thisEvent.EventStartDate.ToString("dd MMM yyyy"));
  sbUser.AppendLine("==============================================================");
  sbUser.AppendLine();
  </code></pre>
  
  <p>(ContentPage and thisEvent are custom classes built using Subsonic(v2). PageTitle is an output type of string)</p>
  
  <p>is get this as an output:</p>
  
  <pre><code>    Please find below confirmation of your registration details. If any of these details are incorrect, please email someone@somewhere.com
  
  Selected event : My Event Date of event : 16 Sept 2012 ==============================================================
  </code></pre>
  
  <p>as you can see, everything after the 3rd line in the code makes everything go on to one line.</p>
  
  <p>however, further down the code i use:</p>
  
  <pre><code>sbRR.AppendLine("First name : " + txtFirstname.Text.Trim());
  sbRR.AppendLine("Surname : " + txtSurname.Text.Trim());
  etc,
  </code></pre>
  
  <p>and all these appear on seperate lines correctly. I can't see why this is happening.</p>
  
  <p>the email is composed as such</p>
  
  <p><code>mailMessage.Body = sbUser.ToString() + sbRR.ToString();</code></p>
  
  <hr>
  
  <p>adding the following code:</p>
  
  <pre><code>sbUser.AppendLine("Selected event : " + ContentPage.FetchByID(int.Parse(ddlEvent.SelectedValue)).PageTitle + Environment.NewLine); 
  sbUser.AppendLine("Date of event : " + thisEvent.EventStartDate.ToString("dd MMM yyyy") + Environment.NewLine);
  </code></pre>
  
  <p>produces the following output:</p>
  
  <pre><code>Selected event : My Event
  
  Date of event : 16 Sept 2012
  
  ==============================================================
  </code></pre>
  
  <p>which works i suppose, except it's added 2 newlines (the AppendLine and the Environment.NewLine). it seems that pulling the data directly straight from the database into a stringbuilder seems to be messing with the line ending. Even if I add text after the database pull, it still stays on one line.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>doing
  <code>StringBuilder.Append("blah"+Environment.NewLine)</code>
  produces the correct result, however i'm still not understanding why that works and <code>.AppendLine("blah"+&lt;database content&gt;)</code> doesn't work.</p>