New Line in E-mail Body

How do I create a new line? I've tried both /n and System.Environment.NewLine, and they don't seem to work, or I'm not using them correctly? So how do you do that, and can you give some example code?

(all I want to see is the string part to be assigned to the body, thanks)

[278 byte] By [xRuntime] at [2007-12-25]
# 1

well if the email is in HTML format then you need to use html tags.

<br> is an html tag for line break - does this work for you?

ahmedilyas at 2007-8-31 > top of Msdn Tech,Visual C#,Visual C# Language...
# 2

Hi there,

This example works (tested). If your are using HTML, you'll need to listen to ahmed

System.Net.Mail.MailMessage m =

new System.Net.Mail.MailMessage("me@mydomain.com", "you@yourdomain.com");

m.Body = string.Format("Hello,{0}{0}this is the second line", "\r\n");

System.Net.Mail.SmtpClient c = new System.Net.Mail.SmtpClient("somestmp.somedomain.com", 25);

c.Send(m);

Regards,

SvenDeBont at 2007-8-31 > top of Msdn Tech,Visual C#,Visual C# Language...
# 3
I didn't even know HTML was possible...

Do I have to specify any settings in order to allow for an HTML body?

xRuntime at 2007-8-31 > top of Msdn Tech,Visual C#,Visual C# Language...
# 4

yup!

in the MailMessage object, set the "IsBodyHtml" to true, this will make the body of the mail message in html format :-)

Example:

MailMessage theEmail = new MailMessage();

theEmail.IsBodyHtml = true;

..

..

ahmedilyas at 2007-8-31 > top of Msdn Tech,Visual C#,Visual C# Language...
# 5
Thanks a lot :) .
xRuntime at 2007-8-31 > top of Msdn Tech,Visual C#,Visual C# Language...