Subject: New line characters
Posted By: lily611 Post Date: 9/24/2004 6:32:51 AM
Hi
I am using a mail component, but my message body is long enough. Can anyone tell me how to use the newline character in C#.
I am using "\n" but its not working.



Reply By: Imar Reply Date: 9/24/2004 10:42:59 AM
Are you sending HTML formatted mail? If so, you need to send <br /> just like you would in a normal HTML page.

Otherwise, try \r\n or post some of your code so we can take a look.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Roads by Portishead (Track 7 from the album: Dummy) What's This?
Reply By: someshtrivedi Reply Date: 9/25/2004 5:45:02 AM
Change the body Format to HTMl and then you can insert <BR /> where ever you want to.
MailMessage MyMessage = new MailMessage();
MyMessage.BodyFormat = MailFormat.Html;

good luck
Somesh

Reply By: planoie Reply Date: 9/27/2004 11:42:51 AM
For plain text email you can also insert a Environment.NewLine for a hard return.  I've had luck with that.
Reply By: lily611 Reply Date: 9/29/2004 4:42:31 AM
Thanks Somesh, <br/> is working.

Reply By: DARSIN Reply Date: 9/29/2004 4:45:07 AM
use chr(13) or chr(10)


Go to topic 19940

Return to index page 760
Return to index page 759
Return to index page 758
Return to index page 757
Return to index page 756
Return to index page 755
Return to index page 754
Return to index page 753
Return to index page 752
Return to index page 751