Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 14th, 2004, 02:26 PM
Registered User
 
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP mail results with no line break

I need help with ASP. Form results need to come on the same line. Now they show up lke this:

Name:
Peter Nes
Address:
Kings rd. ...and so on. But I want them too look like this:

Name: Peter Nes
Address: Kings rd

In other words on the same row (subject and result)
Can anyone help? here is the code:
<%
Dim t1name,t1,t2name,t2,t3name,t3,t4name,t4,t5name,t5, t6name,t6,t7name,t7,t8name,t8,t9name,t9,t10name,t1 0,t11name,t11,t12name,t12,t13name,t13,t14name,t14, t15name,t15,t16name,t16

t1name = "namn"
t1 = Request.Form("t1")
t2name = "företag"
t2 = Request.Form("t2")
t3name = "adress"
t3 = Request.Form("t3")
t4name = "postadress"
t4 = Request.Form("t4")
t5name = "telefon"
t5 = Request.Form("t5")
t6name = "epost"
t6 = Request.Form("t6")
t7name = "snabbexpo"
t7 = Request.Form("t7")
t8name = "quickscreen"
t8 = Request.Form("t8")
t9name = "banner/smartstand"
t9 = Request.Form("t9")
t10name = "tower"
t10 = Request.Form("t10")
t11name = "expand2000"
t11 = Request.Form("t11")
t12name = "bigfabric"
t12 = Request.Form("t12")
t13name = "vario"
t13 = Request.Form("t13")
t14name = "mässmonter"
t14 = Request.Form("t14")
t15name = "broschyrställ"
t15 = Request.Form("t15")
t16name = "diskar"
t16 = Request.Form("t16")

Dim stname,st
stname = "önskemål"
st = Request.Form("st")



Dim ObjMail
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
ObjMail.To = "[email protected]"
'in the next line you can change that email address to something else
'like "[email protected]", just be sure and put it between quotes " "
ObjMail.From = "[email protected]"
'you can also change "Form Submission" to something else like "form results" etc.
ObjMail.Subject = "Epost från hemsidan"
ObjMail.Body = t1name & vbcrlf&_
t1 & vbcrlf&_
t2name & vbcrlf&_
t2 & vbcrlf&_
t3name & vbcrlf&_
t3 & vbcrlf&_
t4name & vbcrlf&_
t4 & vbcrlf&_
t5name & vbcrlf&_
t5 & vbcrlf&_
t6name & vbcrlf&_
t6 & vbcrlf&_
t7name & vbcrlf&_
t7 & vbcrlf&_
t8name & vbcrlf&_
t8 & vbcrlf&_
t9name & vbcrlf&_
t9 & vbcrlf&_
t10name & vbcrlf&_
t10 & vbcrlf&_
t11name & vbcrlf&_
t11 & vbcrlf&_
t12name & vbcrlf&_
t12 & vbcrlf&_
t13name & vbcrlf&_
t13 & vbcrlf&_
t14name & vbcrlf&_
t14 & vbcrlf&_
t15name & vbcrlf&_
t15 & vbcrlf&_
t16name & vbcrlf&_
t16 & vbcrlf&_

stname & vbcrlf&_
st



ObjMail.Send
Set ObjMail = Nothing
'HERE you make a choice. You can redirect the user to any page in your site
Response.Redirect "tack.html"
'Or just say thanks. Delete the line you dont want. Either above or below
Response.Write"Thank You"
<%
Dim t1name,t1,t2name,t2,t3name,t3,t4name,t4,t5name,t5, t6name,t6,t7name,t7,t8name,t8,t9name,t9,t10name,t1 0,t11name,t11,t12name,t12,t13name,t13,t14name,t14, t15name,t15,t16name,t16

t1name = "namn"
t1 = Request.Form("t1")
t2name = "företag"
t2 = Request.Form("t2")
t3name = "adress"
t3 = Request.Form("t3")
t4name = "postadress"
t4 = Request.Form("t4")
t5name = "telefon"
t5 = Request.Form("t5")
t6name = "epost"
t6 = Request.Form("t6")
t7name = "snabbexpo"
t7 = Request.Form("t7")
t8name = "quickscreen"
t8 = Request.Form("t8")
t9name = "banner/smartstand"
t9 = Request.Form("t9")
t10name = "tower"
t10 = Request.Form("t10")
t11name = "expand2000"
t11 = Request.Form("t11")
t12name = "bigfabric"
t12 = Request.Form("t12")
t13name = "vario"
t13 = Request.Form("t13")
t14name = "mässmonter"
t14 = Request.Form("t14")
t15name = "broschyrställ"
t15 = Request.Form("t15")
t16name = "diskar"
t16 = Request.Form("t16")

Dim stname,st
stname = "önskemål"
st = Request.Form("st")



Dim ObjMail
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
ObjMail.To = "[email protected]"
'in the next line you can change that email address to something else
'like "[email protected]", just be sure and put it between quotes " "
ObjMail.From = "[email protected]"
'you can also change "Form Submission" to something else like "form results" etc.
ObjMail.Subject = "Epost från hemsidan"
ObjMail.Body = t1name & vbcrlf&_
t1 & vbcrlf&_
t2name & vbcrlf&_
t2 & vbcrlf&_
t3name & vbcrlf&_
t3 & vbcrlf&_
t4name & vbcrlf&_
t4 & vbcrlf&_
t5name & vbcrlf&_
t5 & vbcrlf&_
t6name & vbcrlf&_
t6 & vbcrlf&_
t7name & vbcrlf&_
t7 & vbcrlf&_
t8name & vbcrlf&_
t8 & vbcrlf&_
t9name & vbcrlf&_
t9 & vbcrlf&_
t10name & vbcrlf&_
t10 & vbcrlf&_
t11name & vbcrlf&_
t11 & vbcrlf&_
t12name & vbcrlf&_
t12 & vbcrlf&_
t13name & vbcrlf&_
t13 & vbcrlf&_
t14name & vbcrlf&_
t14 & vbcrlf&_
t15name & vbcrlf&_
t15 & vbcrlf&_
t16name & vbcrlf&_
t16 & vbcrlf&_

stname & vbcrlf&_
st



ObjMail.Send
Set ObjMail = Nothing
'HERE you make a choice. You can redirect the user to any page in your site
Response.Redirect "tack.html"
'Or just say thanks. Delete the line you dont want. Either above or below
Response.Write"Thank You"
%>


 
Old November 15th, 2004, 03:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

That is because you use a VBCRLF there, where you wanted it to be on the same line.
Code:
ObjMail.Body = t1name & vbcrlf&_
t1 & vbcrlf&_
Which should look like.
Code:
ObjMail.Body = t1name " : " & t1 & vbcrlf&_
Use VBCrLF only where you want a LINE BREAK.

Hope that helps.
Cheers!


_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Line break on mail sent Maxxim ASP.NET 1.0 and 1.1 Basics 3 September 4th, 2006 11:45 AM
line break problem XSLT 1 February 20th, 2006 11:18 AM
break up line crmpicco Javascript How-To 1 June 6th, 2005 06:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.