PHP
Form Mailer
         by Not2Sure

We have all seen them and most people use them but PHP form mailers are become a must for a web site and I will show how to make one with no knowledge of PHP needed.

The PHP Code
Do not edit this unless you know what you are doing:

[ save this as mailer.php ]

 

 Note
You can change the line:

"Thank you for submitting our form. We will get back to you as soon as possible."

With your own message. This is the message you will see after you submit the form.



Setting Your Properties
Change these settings to your information.


$to = "me@this.com";
Change "me@this.com" to your email. (you must keep the "" marks)

$subject = "Results from your Request Info form";
This will be the subject of the Email when it is sent.

$headers = "From: My Site";
This will be who it is from, usually My site or something like that.

$forward = 0;
redirect? 1=yes 0=no (this is the page you go to after you submit the form. if left on 0 you will see a message then nothing will happen if you select 1 you will see a message then go to the redirect page.)

$location = "yoursite.com";
This will be the page you are redirected. (if you keep it 0 you do not need one just delete "yoursite.com"; and leave ""; instead)


Now you have changed each option to your needs paste each line under the first line of the PHP code you made earlier (mailer.php)
 


 
[ copy each line like this but with you settings ]

HTML code
this is were the script becomes very useful. you can add as many input boxes, radio buttons, check boxes etc as you like with no change to the PHP code.


Make a new form using these settings.



And Between the >< add you input options


Help with Input options:

Single line text:


Text Area:


Submit Button:



When you add an input field add NAME="". Between the "" add a unique name for each field. So when you receive an Email it will look like this.
 


There are many more, if you get stuck ask on the forums.


That is it. make sure you PHP code is in the same directory as the HTML code or you can link to it like by changing action="mailer.php" to something like action="http://www.mysite.com/mailer.php" in the HTML code.

Download Now

I hope this information helped. If you have any questions or comments, please don't hesitate to post them on the forums found by clicking here.

Regards,
Not2Sure

 




SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple.