C# – .NET Email Content – Line Breaks

cemailnetoutlook

I've got an application that sends nicely formatted processing logs to the user.

When I run the application locally (debug mode), using [SMTPServer] to send, the logs arrive neatly formatted and look as I'd expect.

When I install the application on a testing server and configure it to use the same [SMTPServer] to send, the logs arrive in my Inbox with the line breaks removed.

Converting to HTML format is not really an option right now.

I realize that Outlook strips them, but I'm confused as to why it does it only when coming from the server.

Thoughts?

Best Answer

I'm not sure this would fix it, but try to add a line break by either using:

System.Environment.NewLine

or simply "\n". The former is better practice, though.