Line break problem

C

chumley

I am using C# sendmail (cdosys.net) and can't get the lines to break
in the MailBody part:

Mail.Body = "Company: " + Request.Form["company"] + \n +"First Name: "
+ Request.Form["firstname"] + \n +"Last Name: " + Request.Form
["surname"]"
+ \n +"Category: " + Request.Form["category"] + \n +"SubCategory:
"
+ Request.Form["subcategory"] + \n +"Zone: " + Request.Form
["zone"]"
+ \n +"Address: " + Request.Form["address"] + \n +"City: " +
Request.Form["city"];

I get an Unexpected '\' error

??
TIA
chumley
 
F

Family Tree Mike

I am using C# sendmail (cdosys.net) and can't get the lines to break
in the MailBody part:

Mail.Body = "Company: " + Request.Form["company"] + \n +"First Name: "
+ Request.Form["firstname"] + \n +"Last Name: " + Request.Form
["surname"]"
+ \n +"Category: " + Request.Form["category"] + \n +"SubCategory:
"
+ Request.Form["subcategory"] + \n +"Zone: " + Request.Form
["zone"]"
+ \n +"Address: " + Request.Form["address"] + \n +"City: " +
Request.Form["city"];

I get an Unexpected '\' error

??
TIA
chumley

Did you literally mean what you sent, or are the \n portions surrounded
by double quotes? They should be...


Mail.Body = "Company: " + Request.Form["company"] + "\nFirst Name: "
+ Request.Form["firstname"] + "\nLast Name: " + Request.Form ["surname"]"
+ "\nCategory: " + Request.Form["category"] + "\nSubCategory:"
+ Request.Form["subcategory"] + "\nZone: " + Request.Form
["zone"]"
+ "\nAddress: " + Request.Form["address"] + "\nCity: " +
Request.Form["city"];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top