473,657 Members | 2,559 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6615
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.co m

<kp******@gmail .com> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.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.co m

<kp******@gmail .com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.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.goo glegroups.com.. .
I am sending it as plain text is all.


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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2303
by: Frostillicus | last post by:
I'm trying to get an ASP to return a zip file to the remote browser from an Image (BLOB) field in SQL Server 2000 but Internet Explorer keeps saying: Cannot open C:\Documents and Settings\Frostillicus\Local Settings\Temporary Internet Files\Content.IE5\U7GXENGF\file.zip The URL to open the zip file is like this: doc_view.asp?id=1&ver=2 ....where id and ver represent the zip file's version in the database. The code I've pieced...
2
1519
by: Zoran Nikolic | last post by:
I would like to store a body of an email message in database (or XML file) and retrieve it as a string. It works well with HTML messages, but have a problem to format text based messages. How to use carriage return?
1
6340
by: mg | last post by:
I'd like to send a single e-mail message message that uses the escape character \n as well as the html tag <i> in the body How can I combine the two parts of this merssage message.BodyFormat = MailFormat.Text String msgTextA = "\n\nFrom: Carol Johnson\n\nSent: Monday, February 9, 2004 message.BodyFormat = MailFormat.Html String msgTextB = "<i> Inventory Control <i>
6
10382
by: Stick | last post by:
Hi, I am trying to start my email app (in this case Eudora) with a programatically generated email. However, Eudora does not seem to recognize any of the ways I have tried to create line breaks. I have tried "\n", "\r\n", and using the StringBuilder AppendLine() method like this: StringBuilder body = new StringBuilder(1024);
3
1238
by: Advo | last post by:
Hi there. Basically, I need to send some details but be able to use new lines. Before we were using asp, which used VbCrLf but now that im writing the pages in PHP we need another way. a code sample is: $details = "------------------------------------------------------------------------------"
3
3604
by: garyusenet | last post by:
I have a programme written in C++, the programme is unmanaged and is an executable, i don't have any source code. I'm writing a C# program. I want to (a) start the programme minimized. (b) send keystrokes to the programme, and mouse strokes. Can you please tell me how I would do this assuming the programme is called "c:\programme.exe"
3
2377
by: dskinibbyb | last post by:
Hi Everybody, I am sending mail using the new class in .Net 2.0. Here while sending internal mails it is giving me problem. Carriage return, Line feed and Spaces are lost while sending mails. I am using msg.BodyEncoding = System.Text.UTF8Encoding.UTF8 to encode the body. But same code and same mail is going fine , when sent to external mails (Like gmail, yahoo, etc.) Please can anyone help me in solving my problem. I even tried...
2
1847
by: Smithers | last post by:
I have a service that will periodically send email messages to system adminstrators. I would like for this service to send a email notification whenever the service is started and when it is stopped. I placed attempted to do that from the OnStart event procedure... but any messages sent during the OnStart procedure are not sent. But when the service is stopped, the email messages from both the OnStart and OnStop event procedure are sent. ...
10
5075
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area> <zone>BOXING</zone> <status>Running</status> <job>1000139233</job>
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.