[thelist] ASP and form question

Madhu Menon webguru at vsnl.net
Mon Jul 8 04:45:01 CDT 2002


At 02:43 PM 7/8/2002, Sharon F. Malone wrote:
>I receive the email (with no syntax errors) but still am getting a blank
>Body. Now I'm not even getting the "Sent by:"

Well, that's simple. With each successive line, you're overwriting the
previous value of objMail.Body
in your code. :)

See, this is what you're doing:

>objMail.Body  = "Sent by: " & Request.Form("fullname") & vbCrlf & vbCrlf_
>objMail.Body = Request.Form("address") & vbCrlf & vbCrlf_
>objMail.Body = Request.Form("city") & vbCrlf & vbCrlf_
>objMail.Body = Request.Form("state") & vbCrlf & vbCrlf_
>objMail.Body = Request.Form("zip") & vbCrlf & vbCrlf_

So what happens?

Line 1: objMail.Body = "Sent by: " & [everything else that comes after that]
Line 2: objMail.Body = [value of Request.Form("address") & 2 Line feeds]
Line 3: objMail.Body = [value of Request.Form("city") & 2 Line feeds]

What you *should* be doing is concatenating the values together.

So you should have:

objMail.Body  = "Sent by: " & Request.Form("fullname") & vbCrlf & vbCrlf_
objMail.Body = objMail.Body & Request.Form("address") & vbCrlf & vbCrlf_
objMail.Body = objMail.Body & Request.Form("city") & vbCrlf & vbCrlf_


In any case, that doesn't seem to be your problem at all. (Hint: post both
the HTML and the ASP code to some web site as a text file so we can check
it out properly.)

Sharon, try this please:

Replace all your "objMail.Body= [...]" lines with this simple line:

objMail.Body = "The quick brown fox jumps over the lazy dog"


Now, test the script and see if your mail has "The quick brown fox jumps
over the lazy dog" in it. I'm almost certain that it's your form variable
names that are the problem. I haven't read your other mail yet (the one
with the lemur's code). I'll see if that tells me anything.

Regards,

Madhu

<<<   *   >>>
Madhu Menon
User Experience Consultant
e-mail: webguru at vsnl.net




More information about the thelist mailing list