Display a Multiline Textbox in an email correctly?

M

Mark Sandfox

The abjective is to allow the user to enter multiple lines of a material
list into an ASP form that will be emailed the the supplier. The user side
works fine, but the resulting email loses its EOL format in the email. Here
is a portion of the code where I think the problem is but I can not find any
documentation on how to solve this obviously simple task.

twTextWriter.RenderBeginTag("tr")
twTextWriter.RenderBeginTag("td width=""150""")
twTextWriter.WriteLine("Material List: ")
twTextWriter.RenderEndTag
twTextWriter.RenderBeginTag("td")
twTextWriter.Write(tbMaterialList.value)
twTextWriter.RenderEndTag
twTextWriter.RenderEndTag


twTextWriter.RenderEndTag

twTextWriter.RenderEndTag
twTextWriter.RenderEndTag
twTextWriter.RenderEndTag

objMailMessage = New MailMessage
objMailMessage.From = "(e-mail address removed)"
objMailMessage.To = Order@****.com
objMailMessage.Subject = "Order From Website"
objMailMessage.Body = swHtmlBody.ToString
objMailMessage.BodyFormat = MailFormat.HTML


Thank you in advance for your help.
Mark P Sandfox
 
M

Mark Sandfox

Sorry, i had some old test code below - replace
twTextWriter.Write(tbMaterialList.value) with
twTextWriter.Write(tbMaterialList.text)
 
N

Nicole Calinoiu

Mark,

To conserve white space in the rendered HTML, try wrapping the text in a
<pre></pre> block.

HTH,
Nicole
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top