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!

How do I Indent a new line in an email?

Status
Not open for further replies.

j9

Programmer
Jun 6, 2001
90
0
0
US
I am using system.web.mail to send an email in asp.net (c#). I would like to format the body of the email message so that it includes an indentation on new lines. Can someone give me an example of how to do this? Thanks!

Here's my code so far:
MailMessage mail = new MailMessage();
mail.To = "someone@someplace.org";
mail.From = "someoneelse@someotherplace.com";
mail.Subject = "this is a test email.";
mail.Body = "Dear Someone," + Environment.NewLine + "I would like this line to be indented.";
SmtpMail.SmtpServer = "somemailserver.com";
SmtpMail.Send( mail );
 
\t" is a tab.
"\r\n" is a new line according to Microsoft.
"\n" should be enough for non microsoft.

Code:
mail.Body = "Dear Someone," + "\r\n\t" + "I would like this line to be indented.";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top