Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Email - New lines not rendering with white-space: pre-wrap

I have an email with a table and one value contains a string with multiple lines. (enter-key) When viewed in outlook or view source in IE, the white-space is not working.

Any idea or any solution?

Thanks.

like image 866
Milo Cabs Avatar asked May 15 '15 08:05

Milo Cabs


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is the full name of C?

In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.

Is C language easy?

C is a general-purpose language that most programmers learn before moving on to more complex languages. From Unix and Windows to Tic Tac Toe and Photoshop, several of the most commonly used applications today have been built on C. It is easy to learn because: A simple syntax with only 32 keywords.

Is C and C++ same?

In a nutshell, the main difference between C and C++ is that C is a procedural with no support for objects and classes, whereas C++ is a combination of procedural and object-oriented programming languages.


1 Answers

This is related to Outlook (not C#). I have the same problem (using Java to send mail). I am using CSS style white-space:pre-wrap; on a span and it works well to preserve tabs, spaces, new lines and wrap text in GMail - web, Android and iOS.

As per my experimentation on Outlook 2016 Windows app and webapp (outlook.office365.com):

  • Value pre-wrap does not preserve new lines in both Windows app and webapp
  • Value pre preserves new lines in Windows app, but does not do so in webapp
like image 74
Shashank Kapoor Avatar answered Oct 14 '22 09:10

Shashank Kapoor