[thelist] ASP and form question

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


At 10:02 AM 7/8/2002, Joel Canfield wrote:
>Agh! I missed that completely.

As did I. I was looking at the ASP code too much.

However, I did suggest in one of my earlier mails (sent within minutes of
Sharon posting) that:

<quote>

a) Have you tried running the script with hard coded values for all fields
instead of the form values? (e.g., "objmail.from = "someone at example.com")?
Does that not work either?

b) Is the SMTP service properly configured on your server? If not, your
mail will never get anywhere.

</quote>

Sharon's answer seems to suggest that b) is OK, so it must be a)

Sharon, this is standard debugging procedure for me:

a) Eliminate the chances of invalid input causing the problem. First check
if your script works by replacing all variables with hard-coded values. If
this sends a mail properly, your basic script is fine, as is your server
SMTP config.

b) Ensure that all variables are returning the expected values. Comment out
the portion of the code that sends the mail. Then Response.Write each
variable to the screen. For example:
Response.Write "From address: " & strFromAddress

(Incidentally, I consider it better to assign variables to all form input
and then reference the variables in the following code. So do strMessage =
Request.Form("message") first, for instance, and then refer to strMessage
from there onwards.)

At this stage, you should be able to figure out what form values are
causing problems. 90% of the time, fixing that will cure your script. Like
Marc pointed out, maybe the names you're using in the HTML form aren't the
same ones you're requesting in your form handler.

c) If everything is fine now, uncomment the mail sending part of your
script and try again. I'm sure it will work.


>Also, better not to use 'name' as a name ;) I use RealName or split it,
>FirstName and LastName.

Good practice in general, although she's not writing to a db, which usually
causes the problems. :)

Regards,

Madhu

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




More information about the thelist mailing list