MailFormat - sending email messages with carriage return

K

kplkumar

I have an email message and the body of that message has to be
formatted in a certain way.

Currently it's Patient Name: XXX Patient Address: 87 XXXX Country: XXX

but I want to have carriage return after each field. For example,

Patient Name: XXX
Patient Address: 87 XXXX
Country: XXX


Can someone tell me how to acheive this? Thanks.
 
N

Nicholas Paldino [.NET/C# MVP]

Why not just place a newline sequence in the string that you use for the
body? You can use the static NewLine property on the Environment class to
do this.

Hope this helps.
 
K

kplkumar

Hi NIcholas

I tried using \n infront of each field but it still seem to come out
with \n
Patient Name: XXX \nPatient Address: 87 XXXX \nCountry: XXX

Anyway, as per your previous email how do I get the NewLine property
going? Can you explain? Thanks in advance.
 
N

Nicholas Paldino [.NET/C# MVP]

Are you sending HTML mail or plain text mail? If you are sending HTML,
then you will have to format the text to use line break tags (<br>) for new
lines, or delimit your paragraphs properly (with <p> and </p>).
 

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