Forum Moderators: open

Message Too Old, No Replies

Can't put line break in ASP Email!

         

skuba

9:51 pm on Apr 26, 2004 (gmt 0)

10+ Year Member Top Contributors Of The Month



I've been trying to add some lines breaks in a ASP email.
I've tried with CHR(10) and with vbCrLf.
Every test I get the emails without the line breaks.

This is how my code is:

body = "Name: " & Request.Form("name") & vbCrLf & _
"Email: " & Request.Form("email") & Chr(10) & _
"Manufacturer: " & Request.Form("mnf") & Chr(10) & _
"Category: " & Request.Form("cat") & Chr(10) & _
"Product Description: " & Request.Form("msg")

Could you guys help?
Thanks

mattglet

10:09 pm on Apr 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check to see if your emails are actually HTML emails being sent, just not plain text. If they are HTML emails, you can use <br> for the breaks. If they are text, then vbcrlf should be fine.

-Matt

Birdman

10:13 pm on Apr 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would try it like this:

body = "Name: " & Request.Form("name") & "\r\nEmail: " &...

Should work for ya.

Birdman

skuba

10:22 pm on Apr 26, 2004 (gmt 0)

10+ Year Member Top Contributors Of The Month



Mattglet, I don't know if it's html or text. The content type is hmtl/text.
Anyway, I tired putting a <br> there and it won't work. I guess because it's text only.

Birdman, the way you described gives me an error. I am not sure the \r\n is supposed to go inside quotes?

Isn't there another way to do this?

Thanks

skuba

10:30 pm on Apr 26, 2004 (gmt 0)

10+ Year Member Top Contributors Of The Month



I got it!

Thanks

body = "<html><body>Name:" & Request.Form("name") & "<br>" & "Email:" & Request.Form("email") & "<br>" & "Manufacturer: " & Request.Form("mnf") & "<br>" & "Category: " & Request.Form("cat") & "<br>" & "Product Description: " & Request.Form("msg") & "</body></html>"