# ASP form is troubling me

**URL:** https://forum.kirupa.com/t/asp-form-is-troubling-me/12559
**Category:** programming
**Created:** [February 1, 2003, 7:06pm UTC](https://forum.kirupa.com/t/asp-form-is-troubling-me/12559 "2003-02-01T19:06:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![zephn](https://avatars.discourse-cdn.com/v4/letter/z/5f8ce5/32.png) [@zephn](https://forum.kirupa.com/u/zephn)
#### Post date: [February 1, 2003, 7:06pm UTC](https://forum.kirupa.com/t/asp-form-is-troubling-me/12559/1 "2003-02-01T19:06:22Z")

</div>

I have a script I downloaded from an ASP tutorial site. It had a “subject” box and a “body” input box.  
I myself have need of 5 boxes in total and I need them displayed in the body of the email.  
If Anyone out there who knows ASP can tell me by looking at this asp form belowwhat I must do to have all the input boxes displayed in the body of the email please let me know.

Dim strTo, strSubject, strBody, strWho, strWhen, strHowMany, strEmail, strPhone  
Dim objCDOMail 'The CDO object  
'#################################################  
##############

strTo = “zephn@sympatico.ca”  
strSubject = Request.Form(“subject”)  
strBody = Request.Form(“body”)  
strFrom=request.form(“strwho”)  
strPhone=request.form(“strPhone”)  
strDate=request.form(“strwhen”)  
strPeople=request.form(“strhowmany”)  
strBody=request.form(“stremail”)

Set objCDOMail = Server.CreateObject(“CDONTS.NewMail”)  
'#################################################  
##############

objCDOMail.From = “RSVPForm”  
objCDOMail.To = strTo  
objCDOMail.Subject = strSubject  
objCDOMail.Body = strBody  
objCDOMail.Send  
Set objCDOMail = Nothing

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 1, 2003, 9:52pm UTC](https://forum.kirupa.com/t/asp-form-is-troubling-me/12559/2 "2003-02-01T21:52:18Z")

</div>

You just need to combine those additional form values into the CDOmail.body like this.

objCDOMail.Subject = strSubject

strDate = "Date: " + strDate + VbCrLf  
strWho = "From: " + strWho + VbCrLf  
strPhone = "Phone: " + strPhone + VbCrLf  
strPeople = "How many: " + strPeople + VbCrLf + VbCrLf

objCDOMail.Body = strDate + strWho + strPhone + strPeople + strBody

note: VbCrLf is the command for a carriage return with line feed.

Does that all make sense?

**abzoid**

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 3, 2003, 6:49am UTC](https://forum.kirupa.com/t/asp-form-is-troubling-me/12559/3 "2003-02-03T06:49:13Z")

</div>

ASP is kinda picky on this, but you should show your line feeds like this

& vbcrlf & \_

that will break the line and wont return errors…Learned this first hand

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 3, 2003, 7:17pm UTC](https://forum.kirupa.com/t/asp-form-is-troubling-me/12559/4 "2003-02-03T19:17:17Z")

</div>

Actually the “& \_” lets the server know that the current command continues on the next line. There is a limit for number of characters on a line, so for the lengthy string commands often used in custom form mail scripts it’s a very handy tool. I like to keep my commands to one line each as I find them easier to debug. Just a personal preference and a throwback to the PASCAL coding I learned over 20 years ago.

**abzoid**

> \*Originally posted by 3d-iva \*  
> \*\*ASP is kinda picky on this, but you should show your line feeds like this

& vbcrlf & \_

that will break the line and wont return errors…Learned this first hand \*\*

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 3, 2003, 7:22pm UTC](https://forum.kirupa.com/t/asp-form-is-troubling-me/12559/5 "2003-02-03T19:22:14Z")

</div>

yeah it was the weirdest thing it should have worked the way you have yours but with mine I was getting errors. So when I found that it worked when I did it this way I just kinda kept doing it…
