Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy RichTextBox -Texts & Table to Email Body ?

Status
Not open for further replies.

Mahey

Programmer
Dec 24, 2008
52
SA
Hi,

I want to paste Texts & Table from RichTextBox to Email Body.
Is it possible?

Dim mm As New System.Net.Mail.MailMessage(FrmMail, ToAddress)

blah...blah...blah...

richtextbox5.copy
mm.body=richtextbox5.paste ???????????

Suppose mm.body=richtextbox5.text is not displaying the table lines...

Any Ideas, Thanks



 
First, to get the richtext you would do
Code:
mm.body = richtextbox5.RTF

Second, that isn't going to work. Even though you can send a Richtext message in most mail programs to do it in VB.net it isn't as simple as just copying it to the message body. System.Net.Mail doesn't understand RichText and you can't make it understand RichText. The only solution I found was to convert the RichText into HTML which System.Net.Mail can understand. I started with this:

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Actually that might be a little misleading. It would be better to say System.Net.Mail doesn't care what the text is but with the .IsHTML method it can tell any receiving program to read it correctly. If there is such a flag for RichText System.Net.Mail doesn't expose it.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top