473,396 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

emailing the contents of a richtextbox

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.

Jul 16 '07 #1
1 1405
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

Jul 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rachel Suddeth | last post by:
I would like to load a file to the .Rtf property of a RichTextBox, and then set the containing form (if possible, depending on screen resolution) to the smallest width that will not cause the...
4
by: Mike Moore | last post by:
What is the best way to launch outlook from an asp.net web page? Can you do this using MAPI or is there a control that you can purchase? We are unable to use SMTP. We use MS Exhange and MAPI...
0
by: Dean | last post by:
Can anyone tell me how to display the file name under the icon of an embedded file? Basically I drag and drop a file into a RichTextBox control and it gives me the file type as opposed to the file...
5
by: Urs Vogel | last post by:
Hi When printing coloured text from a RichTextbox, it turns out to be a quite and timeconsuming job to position all differently coloured strings on the Page with DrawString(). Is there a...
2
by: PJO | last post by:
I've got a Print menu item on a parent navigation form. How can I get it to print the contents of a RichTextBox located on a child form? TIA -Pat
1
by: mridulmurari | last post by:
Hey. I need help with a certain problem I'm facing in VB6. I need to display the contents of multiple items in a listview. The situation is this : Everytime i double-click on an item in a...
0
by: paulhux174 | last post by:
Emailing a web page to several addresses Hi, I need to send the contents of a web page to several email addresses (4). Some elements of the Form I want to hide for some and some elements of the...
0
by: Vimalathithan | last post by:
I just developing a editor. I have provide the options like Bold, Italic, underlin, font change, font size change. These font options are keep in with one toolstripbutton. the toolstripbar keep...
1
by: Ang | last post by:
Hi, How can I save two richtextbox contents into a file? if simply join two richtextboxes like joining two string, the output file will not show the value of second richtextbox. Thanks for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.