PDA

View Full Version : Need Help with Contact Form



Alley Oop
09-23-2006, 01:04 PM
I've just created my first contact form. But when I tested and clicked submit, instead of sending the message to the e-mail address as I intended...

it opened my mail application.

What gives?

Here's the page. Any help appreciated to tell me where I went wrong.

I just want a form that sends the user's message to my e-mail address.

Thanks!

wildjokerdesign
09-23-2006, 02:45 PM
You have set the action of the form to your email address like this:

<FORM ACTION="mailto:username@example.com" METHOD="POST" enctype="text/html">
I replaced your actual email addy with a dummy.. don't want spam sent your way. ;) The method you have chosen is working the way it is supposed to I think. It uses the persons local email client to send out the form submissions as a POSTDATA.ATT attachment. I have never seen this method used before but did a test send of your forum and that is what it did. You won't recieve anything from my test because I canceled the send. I am not sure this is the best way to do things. You might be better off useing the WestHost supplied FormMail App or an alternative to it, if you are willing to do a manual install, NMS FormMail (http://nms-cgi.sourceforge.net/). I personally like and use the TFMail alternative that is listed on the Download page of the link I provided.

wildjokerdesign
09-23-2006, 02:58 PM
I did a bit more exploring of the method you used by setting up a test form on one of my accounts. First it throws up a warning when I use it. Not sure if that would happen with everyone or if it is because of the security I run on my computer. That may deter many from using your form. Second the attachment it sends you is not readable in a normal way. You would have to open it in a plain text editor more then likely and the output is still not very readable. :)

Alley Oop
09-23-2006, 03:34 PM
You might be better off useing the WestHost supplied FormMail App or an alternative to it, if you are willing to do a manual install, NMS FormMail (http://nms-cgi.sourceforge.net/). I personally like and use the TFMail alternative that is listed on the Download page of the link I provided.

Thanks, Shawn. I'll check out the alternatives from the link you provided. I think those will work better, and I think they will allow submission without having my e-mail address in the source code.

Thanks!

Alley Oop
09-23-2006, 03:46 PM
I know how to install the Westhost form app--just do it though the site manager.

But how would you install a third party app not provided?

[Deleted next question because I just found the answer in the Westhost manual]

Thanks!

wildjokerdesign
09-24-2006, 10:25 AM
For NMS FormMail you unpack the download you get from them and then upload the files to your account. There is documentation in the package you download (I think it is a readme file) that explains the configuration file and what you need to change. Also gives you further instructions on uploading and the permissions you would need to set. This is pretty standard for any perl or cgi script that you would want to run on your account.

One thing to remember is that when you edit files you want to do it in a plain test editor like NotePad, it comes with Windows, and that you want to upload cgi/perl files in ASCII mode. You use an FTP program to upload and the WestHost manual suggest WS_FTP and has a version of it that is free to download.

For editing files I use a program called EditPlus (http://www.editplus.com/). As I mentioned above you can use NotePad that comes with Windows but I like this program better since it has features for dealing with perl, cgi and php files.

If you happen to decide to go with TFMail from the site I linked in my first post there is an auto installer that you can upload to your account and run that works fine on WestHost accounts. TFMail gives you more control, in a user friendly way of the output of the form.

Alley Oop
09-24-2006, 02:25 PM
For NMS FormMail you unpack the download you get from them and then upload the files to your account. There is documentation in the package you download (I think it is a readme file) that explains the configuration file and what you need to change. Also gives you further instructions on uploading and the permissions you would need to set. This is pretty standard for any perl or cgi script that you would want to run on your account.

Okay. That sound pretty straight-forward. I use Dreamweaver as my FTP client. Does NMS FormMail require that you put your e-mail address in the source code?

I used finished configuring the WestHost supplied FormMail [see here] (http://shaunsaxon.com/contact.html), but I don't like that my e-mail can be grabbed in the source code by spammers.

wildjokerdesign
09-25-2006, 09:49 AM
NMS FormMail is a bit different then the WestHost FormMail. This bit of text comes direct from the readme file that comes with the package:

%recipient_alias - A hash for predefining a list of recipients in the
script, and then choosing between them using the
recipient form field, while keeping all the email
addresses out of the HTML so that they don't get
collected by address harvesters and sent junk email.

For example, suppose you have three forms on your
site, and you want each to submit to a different email
address and you want to keep the addresses hidden.
You might set up %recipient_alias like this:

%recipient_alias = (
'1' => 'one@your.domain',
'2' => 'two@your.domain',
'3' => 'three@your.domain',
);

In the HTML form that should submit to the recipient
'two@your.domain', you would then set the recipient
with:

<input type="hidden" name="recipient" value="2" />


This is just one of the configurations you set up in FormMail.pl. As you can see it allows you to use just about anything you want in the HTML page that you want. This keeps your email addresses from being harvested. Now I sould suggest that you do not set the value or key of the recipient_alias array to the username but use something like the 1,2,3. So if the email addy is info@example.com do not use info as the value/key but something else.

Alley Oop
09-25-2006, 10:45 AM
Thanks for that source code and installation advice. I definitely want to change to that mail form when I get time.

Thanks!