FORM MAILER SCRIPT

Download form_mailer.zip

There are many different methods or components that you can use on a web server. You could have:

  1. You can use a Common Gateway Interface (CGI) script written with Perl or Java or a server-side technology like PHP, ASP, or Coldfusion to send form fields to a database. However, this requires you to know how to program in one of these languages. After processing the page, it is usually redirected to another page (i.e.,  thankyou.html)
  2. You can simply use an email address as the action attribute of the form tag (<form action="mailto:your_name@your_email_address.com"> .....</form>). After processing the page, the browser reloads the page. NOTE: Notice the mailto: protocol in the front of the e-mail.
  3. However, this tutorial will show you how to use a form mailer script to process your form and send the information to you in a more formatted style than option 2. Like CGI and server-side technologies, after the page is processed, it is usually redirected to another page (i.e.,  thankyou.html)

Download a Form Mailer Script and its Instructions

There are many form mailers for the various types of server-side technologies, etc. that you could download. For example, there is one ASP, PHP, Coldfusion and CGI. One of the most popular is the PHP Form Mailer (formmail.php) that we have provided for you in the zip file. 
NOTE: You may want to search the web for an updated version if you need to.
NOTE: Don't use CDONTS for ASP or CF as they may be discontinued due to capatibility with Microsoft Windows Server 2003.

Create a Form

Create a page (usually the Contact Us page) with a form on it and include all of the necessary form elements you need including a Submit button.

At Rich Media Creative Services, we're here to listen and help.  Fields marked with an asterisk (*) are required.


Create a Thank You Page

Create a Thank You page to your liking with text and/or graphics.

THANK YOU!!!

Your email has been sent successfully.

We will make every attempt to response to your request as soon as possible.  Thank you for visiting Rich Media Creative Services.

Best regards,

Rich Media Creative Services
Building richer web experiences
If you can dream it, we can make it a reality.

Add Fields to the Form

Using the PHP Script that is provided, all you need to do is add the following three hidden fields anywhere in the form tag of your form page. After the Submit button is fine.

  1. While optional, it is highly recommended that you mask your email address from any spammers. You can add any random numbers/alphabets you want to as the recipient value:

    <input type= "hidden" name="recipient" value="987654321a,123456789b" />

  2. Add a subject value that will appear in the Subject field of the email:

    <input type= "hidden" name="subject" value="Email from YourCompanyName Web Site" />

  3. Add a redirect value that will take the user to a Thank You page.

    <input type= "hidden" name="redirect" value="thankyou.html" />

Edit the Form Script

Edit the PHP Form Mailer Script in Dreamweaver or another editor.  While there are many parameters you can update (See Form Script documentation page on how to update all of them), we will only update only a few of the required fields and a few others.

Make a backup copy of the form mailer (in our case, formmail.php) just in case you need a fresh copy and then make changes to the original file by updating the following lines to match your web site domain names, etc:

Line 40: $referers = array('www.your_company_name.com', your_company_name.com');

Line 44: $recipient_array = array('287654319a' => 'your_name@your_company_name.com', '923456781b' => 'support@your_company_name.com');

Line 63: ini_set("SMTP","mail.your_company_name.com");

Line 70: ini_set('sendmail_from', 'your_name@your_company.com');

NOTE: See form mailer documentation for complete detail instruction.

Upload Files to Your Server

Upload the form page any where on your site.  However, upload, the PHP Form Mailer script and the Thank You page to the same directory the PHP Form Mailer Script is in.

BONUS: FREE EMAIL FORM EXTENSIONS(verify links)

Below is a list of free extensions that will allow you to add email form processing without programming:

Commercial extensions: