how to make the ASP Formmail
script work that I found
yesterday.
I wrote about it here:
Choosing an ASP FormMail Program
Now I'm back to figuring out
the script which is found
here:
Brainjar ASP FormMail
The first step that I need
to figure out is what SMTP
server to send it to?
OK. I think I have it
figured out. In this
case, the name of the
SMTP server is fairly
conventional. It is:
smtp.mydomainname.com
This is a very very
common naming convention
for SMTP servers, in
my experience.
SMTP server names tend
to be web-hosting company
specific. However, this
is a very common way to
do it.
In effect, the hosting
company is giving every
domain their own virtual
SMTP server.
The field name in this
case is smtpServer.
That's the name of the
field in the script.
Thus I need to say
in the code:
smtpServer = "smtp.mydomainname.com"
The next thing I need
to figure out is the
from-address. The from-
address field name is
fromAddr.
I'll put my own email
address in this field
for now.
Thus I'll say in the
code:
fromAddr = "my-email@mydomain.com"
Later, I think I will
change it to the email
address of the person
submitting the form.
When using NMS FormMail,
I've found there's an
advantage to doing this
and this is that it
makes it very easy to
reply to the person.
Just hit reply and you
can compose a reply email
to the person who submitted
the form.
That's the advantage of
setting the fromAddr
field to the email of the
person who submitted the
form. It makes the
submitted form easier
to reply to.
For now, though, my own
email address will do as
all I care about right
now is getting the thing
to work.
Here's a field I just
barely understand:
mailComp
I believe this stands for
mail component.
IIS is a Microsoft
server and mail component
is Microsoft terminology.
The script seems to support
the following components:
- ASPMail
- CDONTS
- CDOSYS
- JMail
These two are Microsoft
products:
- CDONTS
- CDOSYS
These two are commercial
products produced by
companies other than
Microsoft:
- ASPMail
- JMail
The script seems to
default to ASPMail
so I will too. If it
doesn't work, I'll try
one of the other three
mail components.
Here's how it looks in
the original script when
initially downloaded:
mailComp = "ASPMail"
OK. The next variable
is allowedHosts.
Basically, you put your
domain name for your website
here. It's that simple.
The idea is to stop someone
from another website from
hijacking your form. That's
the basic idea.
The next one is
allowedRecipients.
This one is extremely important!
Basically, you only want yourself
to be the recipient of your form.
Therefore, you only put your own
email address here, generally
speaking.
Script Parameters
Versus Control Fields
The documentation for the script
seems to differentiate between
script parameters and
control fields.
What's the difference?
Basically, control fields
are client-side and script
parameters are server-side.
In other words, control fields
are part of your HTML form and
script parameters are part
of the script that processes the
HTML form.
This is consistent with Matt Wright's
original FormMail script. He too
had variables in both the client
and the server.
In this case, the client is your
form on your web page. The server
is the FormMail script that processes
the form and send it to you.
I continue my investigation into
ASP FormMail here:
ASP FormMail, Part III
Ed Abbott
No comments:
Post a Comment