Email Body New Line

M

Morris Neuman

Hi,

I want the EmailBody to have new line between fields. Tried '\n' as well as
"\n" but neither work.

My string is as follows:
string EmailBody = "Name=" + TextBox1.Text + '\n' + "Phone=" + TextBox2.Text
+ " Email=" + TextBox4.Text + " Message=" + TextBox3.Text + " Remote Host=" +
RemoteHost;
 
M

Morris Neuman

Hi,

I was able to get a new line using <br></br>

string EmailBody = "Name=" + TextBox1.Text + "<br></br>" + "\n Phone=" +
TextBox2.Text + " Email=" + TextBox4.Text + " ProductName=" + TextBox6.Text +
" Message=" + TextBox3.Text + " Remote Host=" + RemoteHost;

Is there another way?
 
A

Allen Chen [MSFT]

Hi Morris,
I was able to get a new line using <br></br>
string EmailBody = "Name=" + TextBox1.Text + "<br></br>" + "\n Phone=" +
TextBox2.Text + " Email=" + TextBox4.Text + " ProductName=" + TextBox6.Text +
" Message=" + TextBox3.Text + " Remote Host=" + RemoteHost;
Is there another way?


This is the correct way to add a new line for HTML format. You could also
wrap text in <p> to create a new paragraph:

http://www.w3schools.com/html/tryit.asp?filename=tryhtml_paragraphs1

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top