473,813 Members | 3,529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.tex t 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 1435
On Jul 16, 1:18 am, plonk <pl...@orcon.ne t.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.tex t 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
2078
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 horizontal scrollbar to appear. Now the RichTextBox must know what width will cause the horizontal scrollbar to disappear because, after all, the scrollbar does disappear if you make it wide enough (the RichTextBox is docked to the form.) Any idea...
4
1654
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 currently for our client/server apps.
0
936
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 name such that you might get when performing the same action in WordPad. Also, has anyone figured out how to email rich text (with embedded files) through MAPI? Basically I need to email text with inline attachments. Thanks in advance,
5
2392
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 better method of achieving this, or are there samples somewhere? Couldn't find anything on MSDN.
2
1691
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
1344
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 listview, a form containing a richtextbox or a dynamically created dialogue box should display the contents of the file. The problem is that i'm not able to view multiple files at the same time. So, is it possible to display a single form containing a...
0
1178
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 Form I want to show for others. i'm using dotNet2 C#. I've looked at the RenderControl method and it worling fine if you onlt render once but I want to render 4 times. Is there an other approach apart from rebuilding the contents of the
0
2062
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 inside with panel. The RichTextBox keep inside with other panel. The panel height and width is same with RichTextBox. The RichTextBox both scrolling options are make it as false. I done the coding for RichTextBox's height to fit with...
1
2299
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 reply. *** Sent via Developersdex http://www.developersdex.com ***
0
9734
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10667
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10407
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10422
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10139
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5568
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.