Search code examples
c#.netweb-controls

Web browser control display plain text mail


I have a c# app which is supposed to display email. the email may be HTML or plain text but i am using web browser control in both cases. the problem is web browser control is ignoring all the escape characters of plain text and the mail appear as a single line.

the work around i am using is to replace escape character "\n" or "\r" to <br>. is there any other good way to do this.

thanks in advance.


Solution

  • You can surround the text with <pre> and </pre> (stands for "preformatted") tag. See here: HTML pre Tag