Simple PHP Form Mailer - How to use


Home | Support Forum | Download | Release note & updates | How to Use | Demo
 
 

Simple PHP Form Mailer require PHP4 + with PHP mail() function support.

 
   
  Download the File & Unzip it.

Edit the file (mail.php) with a Text Editor. (DO NOT USE MS FrontPage) use VI (Linux/Unix) or Notepad, WordPad or similar test editor or a PHP Editor in Windows.

Setup the following variables in the script.

   
  After Ver 1.8 of the scrip, you need to edit the config.php
   
$subject = ""; Ex: $subject = "Simple Form Mailer"; this is what you will see in the email you get when some one submit your Form.
   
$mail_to = ""; This is the place you need to setup, so the script knows where to send the mail to. you can set this to the email address where you want your form to be sent to. Eg: $mail_to = "me@myisp.com"; also you can set multiple addresses here as well, Eg: $mail_to = "you@yourdomain.com, me@myisp.com, me@yahoo.com";

this is in Ver 1.8 or High

   
$from = ""; $from = "kalinga@kalinga.com";  this is what will be used as the form email address of the email you get when some one submit your form, how ever is there is a Form feels or a text box call "email" ( <input type="text" name="email" size="20"> ) the script will ignore this & use the field in the HTML Form.
   
$error_repote = 1;  this is the place you will set what the script will do after successfully sent an email or if it fail. if this is set to "1" then the script will use the Simple Text error messages that you define in the "$ok_msg & $error_msg", if this set to "0", the script will use the Forward to pages define in "$error_page & $mail_send"
   
  you need to set this if you have setup $error_repote = "'; to $error_repote = "0"; this is where the script will forward if the email was sent or is the form was black or any error.
$error_page = ""; here you can setup the error page, Eg: $error_page = "http://www.yorsite.com/errorpage.html";

Ver 1.9.4 or High --> if you put the same page as your form, error messages will be displayed on the top of the form it self. but you must use $error_repote = 0; as well.

$send_page = ""; here you can setup the submit sucseefull page. Eg: $send_page = "http://www.yorsite.com/thankyou.html";
   
  you need to set this if you have setup $error_repote = "'; to $error_repote = "1"; this is where you define the text error messages the script show after email was sent or is the form was black or any error.
$error_msg = "Sorry, Error Sending Email!"; Here you can change the default error message.
$ok_msg = "Thank you, Email was Sent!"; Here you can change the default Thank you message.
   
mail("you@yourdomain.com", This is the place you need to setup, so the script knows where to send the mail to. you can set this to the email address where you want your form to be sent to. Eg: mail("me@myisp.com", also you can set multiple addresses here as well, Eg: mail("you@yourdomain.com, me@myisp.com, me@yahoo.com",

This is in Ver 1.6 and lower.

   
$form_names = array("T1", "T2"); this is where you can set your mandatory form fields, let say if your need 3 fields call name, address and phone you need to set the $form_names = array(); as

$form_names = array("name", "address", "phone");

this only validate if the form field is blank.

   
$img_validate = 0; This is to enable the image validation, this is a beta add-on so by default its off. if you set $img_validate = 1; you will enable the image validation. you must read the img_validate_howto.txt file that comes with the zip file.

you also need GD, MD5 support in PHP to use this.

Note: Get the form to work with out the Image Validation first, before you try to enable it.

   
$send_reply = 1; This will make the script send out an email to the person who submit the form. (if you have a filed call email in your form for the user to enter his email)

1 will enable this and 0 will disable it.

you need to set your reply email in the reply_email.txt you can simply use text or HTML code in the reply email.

this is in Ver 1.9 or High

   
$reply_email_subject = ""; this will be the from subject of the script will use to send the reply email to the person who submit the form.

this is in Ver 1.9 or High

   
$reply_email_from = ""; this will be the from email address the script will use to send the reply email to the person who submit the form.

this is in Ver 1.9 or High

   
$reply_email_form_name = ""; this will be the form name of the reply email the script will send to the person who submit the form, let this blank for the script to use your domain name.

this is in Ver 1.9 or High

   
  Now save the file and upload it to the server where your form is, to the same dir. and change the action on your HTML form to mail.php

Eg: <form method="POST" action="mail.php">

save your form and upload it to your web server.

submit your form and check your mails. also its a good idea to add a field call email so the script can use the submitting users email as the mail from in the email it send out.

   
   
This script has been tested on Windows XP Apache2 PHP5, CentOS 4 & 3 Apache PHP4 (CPanel Server), RedHat 7.3 Apache PHP4 (CPanel Server) & Development done on SunOS 5.10 (Solaris 10 x86_64) Apcahe2 & PHP5
 

Having any problems ? use our Support Forum

 

If you need to custom Form developed, Please contact us for price information.


Copyright © ORBIT NETWORK ® 2006