As shown in the comments above, the most common reason for this behavior is trying to send plain text as an HTML-encoded message. The carriage return/newline characters have no meaning in HTML, so the line breaks do not show up. So, there are two quick fixes:
- Make sure the
IsBodyHtml
property is set to false on yourMailMessage
object(s), or Replace any instances of
\r\n
with<br />
elements, then setIsBodyHtml
to true. This can be done with one simple line:_yourEmailContent.Replace(Environment.NewLine, "<br />").ToString();
Another alternative is to encode/convert the newline/return characters as entities:
_yourEmailContent.Replace(Environment.NewLine, "
").ToString();