C # Email - newlines not showing with space: pre-wrap

I have an email with a table and one value contains a string with multiple lines. (enter-key) Blank space does not work when viewed in view or browse mode in IE.

Any idea or any solution?

Thank.

+3


source to share


2 answers


New lines inside html are not rendered as such. You need to add tags <br>

at the end of each line to make sure the email displays correctly with new lines.



You can do this in your C # code by replacing every new string character in your problematic value with <br>

.

+1


source


It is related to Outlook (not C #). I have the same problem (using Java to send mail). I use white-space:pre-wrap;

on-span CSS styling and it works well to keep tabs, spaces, newlines, and wrap text in GMail - web, Android and iOS.

According to my experiments on Outlook 2016 Windows app and webapp (outlook.office365.com):



  • Pre-wrap value does not preserve newlines in both windows app and webapp
  • The pre value preserves newlines in a Windows application, but does not do so in a webapp
+1


source







All Articles