How to sent txt and html from richtextboxes

Hi!

Have this code:

Dim myMessage As System.Web.Mail.MailMessage
            myMessage = New System.Web.Mail.MailMessage
            myMessage.To = til
            myMessage.From = txtFrom.Text
            myMessage.Subject = txtSubject.Text
            myMessage.Body = Me.header.Text & Chr(10) & Chr(10) & body2.Text



 myMessage.Body = Me.header.Text & Chr(10) & Chr(10) & body2.Text
 Send from 2 richtextboxes, where the 1 textbox is NOT HTML
But the other is HTML

My problem is that i cant get linebreaks from the first richtextbox ?

How can i solve this ?
LVL 2
team2005Asked:
Who is Participating?
 
s_chilkuryConnect With a Mentor Commented:
Try this alternative...

Read each line in the first RTB (RichTextBox) ...

and put a .Text +  Environment.NewLine and store in the String Builder for each line ...

Then use this StringBuilder.ToString()
0
 
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
Hi,
Please try one of following:

myMessage.Body = Me.Header.Text & "<br />" & body2.Text
or
myMessage.Body = Me.Header.Text & Environment.NewLine & body2.Text

Thanks
0
 
team2005Author Commented:
Hi!

IJZ -> dosent work

s_chilkury -> can you please give me example of what you meen.
Thanks
0
 
CodeCruiserCommented:
Have you set the

MyMessage.IsBodyHTML = True?
0
 
team2005Author Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.