[thelist] ASP and form question

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


As you all were replying I was putting together the last email I just sent you all a few minutes ago.

Brian, you suggested I write Dim strBody at the beginning of the script

As it stands now, I have <%
Dim objMail
set objMail = Server.CreateObject("CDONTS.NewMail")

How would I incorporate Dim strBody into this correctly? This may be why I'm not receiving the input from the  fields on the form I'm filling out (altho I'm now getting the Field Names to display????

Sharon

On Monday, July 08, 2002 3:52 PM Brian wrote:

> Sharon,
>
> I think that perhaps objMail.Body is expecting to see a string on the
> right-hand side - not another object.
>
> I would try one of two things:
>
> One: (Not sure if this will work for reason stated above.)
> objMail.Body = ""
> objMail.Body = objMail.Body & "address: " & Response.Form("address") &
> vbCrLf
> objMail.Body = objMail.Body & "city: " & Response.Form("city") & vbCrLf
> ...
>
> This intializes objMail.Body to an empty string first. If it chokes
> again on Line 10 with the same error, you'll have to try option two.
>
> Two: (I would do this personally. I believe this was suggested earlier
> as well.)
> Dim strBody
> strBody = "address: " & Response.Form("address") & vbCrLf
> strBody = "city: " & Response.Form("city") & vbCrLf
> ...
> objMail.Body = strBody
>
> This concatenates as string then assigns it to the .Body object.
>
> Also, if you intend to write back some of the form information in a
> response screen or if you are using HTML mail, you might need to encode
> it for characters like < and >.  You'll use something like:
>
> Response.Write(Server.HTMLEncode(strInput))
>
> where strInput = strBody for example.
>
> This will convert the string: <p>address: 123 commerce street</p>
> to &lt;p&gt;address: 123 commerce street&lt;/p&gt;
>
> Hope this helps.
> -Brian
>
>
> Sharon F. Malone wrote:
>
> >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?
---------------------------------------------------------------------------
Sharon F. Malone
"web design and Internet writing services"
http://www.24caratdesign.com
sfmalo at 24caratdesign.com




More information about the thelist mailing list