How to create carriage return or line feed or new line

  • Thread starter Thread starter Dave Tichenor
  • Start date Start date
D

Dave Tichenor

How do you create a new line in the mail message; i'm using asp.net.

I try using - vbcrlf
- chr(13) and chr(10)
- Environment.NewLine

But when i receive the email message it is concatenated all together.

thanks


Please see my code below

msg.Body = TextBox5.Text & chr(13) & chr(10) & _

Label2.Text & " = " & TxtName.Text & chr(13) &
chr(10) & _

Label1.Text & " = " & TxtAdd.Text + " " +
TxtCity.Text
 
Hi Dave,


Thanks for posting in the community!
From your description, you 're wanting to send a certain text as the body
of email in yoru ASP.NET application. However, you encountered some
problems when try put some return(start new line) flags in the text ,yes?
If there is anything I misunderstood, please feel free to let me know.

As for the problem, I'd like to confirm some further things on it:
1. Is the mail you'd like to send use "Plain Text" format body or "Html"
body?
If html, I think you may need to use the "<br>" html tag to let the content
return, just as Curt_C has suggested.

2. If you're using plain text, I think you may have a try using an large
block of text( retrieving from a exist txt file or from and textarea on the
page) which contains multi-lines as the mail's body to see whether this
problem remains.

Please check out the preceding suggestions. If you have any questions,
please feel free to post here.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Back
Top