471,325 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

MailFormat - sending email messages with carriage return

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.

Feb 1 '06 #1
5 6526
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<kp******@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
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.

Feb 1 '06 #2
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.

Feb 1 '06 #3
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>).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<kp******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
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.

Feb 1 '06 #4
I am sending it as plain text is all.

Feb 1 '06 #5
<kp******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I am sending it as plain text is all.


Use Environment.Newline instead of \n
Feb 1 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Zoran Nikolic | last post: by
10 posts views Thread by Markgoldin | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.