On Jul 16, 1:18 am, plonk <pl...@orcon.net.nzwrote:
Hi
I'm having a small problem with a vb.net application (Visual Studio
2005)
I'm trying to insert the contents of a Richtextbox.text into the body
of an email.
It all works fine, except when I open the email, all the carriage
returns and linefeeds are stripped out and all the text appears on one
line.
I'd appreciate some suggestions on how I can resolve this.
thanks in advance
Paul.
Assuming you are displaying the email body as html (IsBodyHtml = true)
you would need to replace each crlf with "<br />" to get the
appropriate line breaks. You could probably do that with a simple
Replace(...), or you could loop through the Lines property of the rich
text box. I also think you would have to replace all the different
fonts and colors with <span style="color: MyColor; font-name:
MyFont;"tags to get that special formatting. I believe I have seen
several rtf to html converters on codeproject.com - so you might look
there if you don't want to roll out an entire solution on your own.
Thanks,
Seth Rowe