[thelist] ASP and form question

Sharon F. Malone sfmalo at 24caratdesign.com
Mon Jul 8 17:26:01 CDT 2002


Hi all!
Have finally slept, had appointment with another client, then settled down to working this script out. Made the suggested changes in the form (eliminating spaces in the form names) and rewrote the script using Joel's sample below. Added 4 spaces before each & vbCrlf & vbCrlf as I was getting a compilation error with the line wrap. Well that worked.  However .... now this is what I'm getting:

Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'Body'

/chocfoundry/html/process.asp, line 9

Line 9 is the first occurrence of objMail.Body = objMail.Body & blah blah.
objMail.Body = objMail.Body & "address: " & Request.Form("address")     & vbCrlf & vbCrlf

What is this???? What do you suggest?

S.

From: "Joel Canfield" <joel at spinhead.com>
Sent: Monday, July 08, 2002 7:46 AM

> 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
> %>
---------------------------------------------------------------------------
Sharon F. Malone
"web design and Internet writing services"
http://www.24caratdesign.com
sfmalo at 24caratdesign.com




More information about the thelist mailing list