[thelist] ASP and form question

Joel Canfield joel at spinhead.com
Mon Jul 8 09:49:00 CDT 2002


Sharon:

Couple changes:
1. As Madhu says, each line of .Body is overwriting the last. Instead, on
each line I'm saying, take .Body and make it equal to .Body *plus* the next
field. In the end, it should have a line for each field with the field name
and field value.
2. I eliminated the spaces in the field names. Spaces are, as my daughter
says, the devil's plaything. Well, she exaggerates, but looking at her
father I'm not surprised ;) But spaces can be problematic in anything except
text strings - imagine if you tried to put a space in your e-mail address,
for instance. I doubt that it's had anything to do with your problems, but
not worth the risk.

Sorry this has taken so many iterations. Had I not been so wrapped up in
other things I would have just re-written this from scratch for you.

I'm cc'ing both my primary addresses. Feel free to do the same if you need
further help, just to be sure I see it. That is, once you're conscious; I
noticed you were up 'til long past midnight our time (you're in California,
right?)

Let us know how it goes, Sharon. I remember well being at the frustrating
early stages like this; trying to make something work when you haven't had
the time to fully absorb what it's all doing.

By the way, this Request.Form thing is definitely common in VBScript/ASP.
Once you've gotten through this, I'll try to find some good online
references to help you get up to speed.

joel
-----------------------------------
<%
Dim objMail
set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "webmaster at 24caratdesign.com"
objMail.Subject = "Web Site Form Request"
objMail.To = "The Chocolate Factory<sfmalo at 24caratdesign.com>"
objMail.BCC = "cheftrain at yahoo.com"
objMail.Body  = "Sent by: " & Request.Form("fullname") & vbCrlf & vbCrlf
objMail.Body = objMail.Body & "address: " & Request.Form("address") & vbCrlf
& vbCrlf
objMail.Body = objMail.Body & "city: " & Request.Form("city") & vbCrlf &
vbCrlf
objMail.Body = objMail.Body & "state: " & Request.Form("state") & vbCrlf &
vbCrlf
objMail.Body = objMail.Body & "zip: " & Request.Form("zip") & vbCrlf &
vbCrlf
objMail.Body = objMail.Body & "homephone: " & Request.Form("homephone") &
vbCrlf & vbCrlf
objMail.Body = objMail.Body & "workphone: " & Request.Form("workphone") &
vbCrlf & vbCrlf
objMail.Body = objMail.Body & "fax: " & Request.Form("fax") & vbCrlf &
vbCrlf
objMail.Body = objMail.Body & "email: " & Request.Form("email") & vbCrlf &
vbCrlf
objMail.Body = objMail.Body & "BestSellers: " & Request.Form("BestSellers")
& vbCrlf & vbCrlf
objMail.Body = objMail.Body & "SpecialtyGifts: " &
Request.Form("SpecialtyGifts") & vbCrlf & vbCrlf
objMail.Body = objMail.Body & "SeasonalSelections: " &
Request.Form("SeasonalSelections") & vbCrlf & vbCrlf
objMail.Body = objMail.Body & "CorporateGifts: " &
Request.Form("CorporateGifts") & vbCrlf & vbCrlf
objMail.Body = objMail.Body & "PartyFavors: " & Request.Form("PartyFavors")
& vbCrlf & vbCrlf
objMail.Body = objMail.Body & "OtherItems: " & Request.Form("OtherItems") &
vbCrlf & vbCrlf
objMail.Body = objMail.Body & "Comments: " & Request.Form("Comments")
objMail.Send
set objMail = nothing
%>



More information about the thelist mailing list