Proformica Marketing Consultants. Marketing, business development, web design, advertising, market research in Sweden and Vietnam
Proformica Marketing Consultants. Marketing, business development, web design, advertising, market research in Sweden and Vietnam
Proformica Marketing Consultants. Marketing, business development, web design, advertising, market research in Sweden and Vietnam
Proformica Marketing Consultants. Marketing, business development, web design, advertising, market research in Sweden and Vietnam

FORMMAIL TUTORIAL.

To send information entered in a form at a website, you need some kind of program. Contrary to what many might think, the browser itself hasn't a clue what to do when the user hits the "Submit" button. The browser desperately needs help.

When a user has your form in his browser, it exists in two places simultaneously: Both downloaded to his computer and residing in your server. Therefore, you can choose to use either the user's individual configuration and applications or something you have set up on the server-side to assist the browser

TAKE CONTROL

If you choose the former, to utilize whatever the user might or might not have in his computer, you (and the user) will sometimes bump into problems. You don't know if he has an e-mail client to use for sending the form. You don't know if he has a working smtp-account for outgoing mail.

You don't know if he has set his preferences to handle the tasks properly. You don't know if the browser he's using will act as you want (yes, some browsers will not send the form but instead tries to launch the user's mail client with a new message).

You don't know if his mail server is working or if he is behind a firewall or within a network that might cause him problems. You don't know if he's using his computer as a fish tank, etc....

If you instead decide to install a script on your server to process the form, you will know and gain control. Then, it doesn't matter how peculiar the user's individual computer preferences are, he will be able to send the form input without problems anyway.

INSTALLING THE SCRIPT

If you haven't installed a formmail before, you might be somewhat hesitant. But relax. If you're smart enough to put together a form, you will fix the script in an hour or less (assuming you haven't found a completely enigmatic version. There are heaps of odd, free formmail scripts out there).

In this example, you need to have a host that's supporting the script language "perl" and has a "sendmail" function. You also need access to your site's "cgi-bin" directory, where the script will reside. If your site is hosted by a regular, commercial host who is charging for the hosting, this will likely not be a problem. Ask him/her/them/it.

(If you're on a "free" host like Geocities and similar, I strongly doubt they will provide what you need. Sorry.)

When the three prerequisites above are met and confirmed, you need a good formmail script. As mentioned, you can find tons of free ones, but we have never seen a better one than NMS Formmail from sourceforge. Add to that, it is easily configured and comes with excellent and detailed instructions (kudos to the people who made it!). Download the "NMSFormMail.zip" from here:
http://nms-cgi.sourceforge.net/scripts.shtml

If you are able to tie your own shoelaces, you will figure out the rest from here. Oh, there's one more thing (isn't it always?): you might need to check/change the "permissions" of both the form and the formmail script to make it work if you're hosted on a Unix server. It's also called to set the "CHMOD".

If that is required, you could either go to the Dreamweaver exchange at www.macromedia.com and get the extension called "Set permissions" or go to e.g. www.versiontracker.com and get a free FTP-client.

INSTALLATION, STEP-BY-STEP

  • Check that your host supports perl, has sendmail and that you have access to the cgi-bin (which is the most frequent name of the directory. If the support staff says "Uh?", then tell them it's the directory where the cgi and perl scripts are stored)
  • Get the path to perl from your host. Usually:
    #!/usr/bin/perl -wT or similar
  • Get the path to sendmail from your host. Usually:
    /usr/lib/sendmail -oi -t or similar.
  • Get a formmail script (a.k.a. form processing script). We recommend the zip archive at
    http://nms-cgi.sourceforge.net/scripts.shtml
  • Create a working html form in your page. If you're having issues with this and using Dreamweaver, look in the help files. Just press F1.
    The form you are creating is the one people will fill in and that eventually will connect to the formmail script. You will probably have to hand code the path to the formmail script.
  • Open the script in a text editor like NotePad (PC) or TextEdit (Mac). Do not use Word or any other word processing program.
  • Configure the script. If you're using the one we recommended above, you'll have no bigger problems if you read the outstanding instructions that comes with it.
  • Spammers are sometimes using a perfectly innocent website's formmail script to send out spam. The unknowing site will show up as sender of the junk. As a minor security measure, you might therefore want to re-name the script to something else than "formmail.pl" or "formmail.cgi", because that's the filename 99.999% of all formmail scripts have, and that's the filename the spammers are looking for.
    Disclaimer: We are not saying that the script will be totally invisible. Far from it. Just that it makes it a little bit harder for them.
    In August 2004 only, spammers have searched this very site for the following files to hi-jack and use to send out their stuff. But since our formmail script has a name like "hsdfyuew5bdsfgjs67d.pl", they have never found it:
    formmail.pl, formmail.cgi, contact.pl, FormMail.pl, fmail.pl, formmail.pl, mailform.cgi, mail.pl, mail.cgi cgi/mail.pl, send-to-a-friend.pl, responsemail.pl, form2mail.pl, form-2-mail.pl, form2mail.cgi, formmailer.cgi, formmailer.pl, form-processor.pl, form-processor.cgi...
    ...plus another 20 or so variations.
  • Upload the html form to your server, wherever you decide to keep it.
  • Upload the formmail script to the server's cgi-bin.
  • If you're hosted on a *nix server, it could be a good idea to check the file permissions (a.k.a. CHMOD) of both the form and the formmail script.
    Set the permissions to 755 using either the "set permissions" extension for DW that's available at the DW Exchange, or use a designated ftp-client for this. If you like to try the latter, go to www.versiontracker.com and search for e.g. "Filezilla" (PC) or "Fetch" or "Transmit" (Mac).
    If you're truly stuck, ask your host for help.

 

Done. Congratulations. Your visitors will now be able to reach you fast and easily!

 

Back to top of page

NEW!Personal ads
for and by expats in Vietnam.
Intro offer: Free ads!
Saigon Classifieds
Hanoi Classifieds