Reputation: 625
so i have an email body I need to send in an email in outlook using a program I wrote in C#. The body string has newline characters in it. I have tried everything to keep outlook from filtering them out. I even have the take out new lines option disabled and it still does it. I have tried every trick i could find on the web. I have tried Enviroment.NewLine and \r\n and anything else. It is so frustrating. Does anyone have any explanation???
Upvotes: 1
Views: 356
Reputation: 1932
If the message is sent as plaintext, most recent versions of Outlook will remove whatever it determines as extraneous newlines in the message to improve readability. Only the end user with the Outlook client has the ability to override this behavior and can do so on a message by message basis.
If you would like to have more control over the layout and formatting of the message, then you should generate your message body as an HTML message rather than a plaintext message. Of course this means that you have to do a little more work to create the message layout you want to use, but it will result in a very nice presentation and gives you much more control over things like vertical alignment and such that you cannot do reliably using just plaintext alone.
Upvotes: 1