PF Recommend
Requirements:
- PHP 4.3+
- Apache webserver
Features/Benefits:
- Database not needed
- Page containing the form doesn't need to have a .php extension
- Installation is just a matter of uploading 4 files to your server
- The email uses a text file(.txt) as a template, so it's very easy to change the outgoing messages
- Supports variable number of emails
Installation:
- Download the zip file and extract
- The extraction will result in 3 php files, one example html file, one email template text file and a readme file
- config.php
- functions.php
- process.php
- email_template.txt
- example.html
- readme.txt
- Open config.php with your text editor of choice and edit the necessary fields following the instructions there
- Upload the 3 php files to your server and thee email template text file, they must all be in the same directory
- Edit your form's ACTION attribute to point to the process.php file you just uploaded, for example:
- <form action="process.php" method="post" />
- Your FORM should have a POST method (GET will not work)
- Add a hidden input field to your form:
- <input type="hidden" name="submit_check" value="1" />
- The sender name form field should have a name attribute with value = "sender_name", for example:
- <input type="text" name="sender_name" />
- The sender email form field should have a name attribute with value = "sender_email", for example:
- <input type="text" name="sender_email" />
- Each friend name field should have a name attribute with value = "friend_name[]", for example:
- <input type="text" name="friend_name[]" /> notice the brackets after the field name
- Each friend email field should have a name attribute with value = "friend_email[]", for example:
- <input type="text" name="friend_email[]" /> notice the brackets after the field name
- That's it!
Editing the email template file (email_template.txt):
The file email_template.txt is the email template that will be used with your form. This file must be named email_template.txt and must be uploaded to the same directory of the php files. This template also has other requirements, please note the pattern of this file:
You can edit all parts represented above with x's; the remaining text must be as shown above, that is, you cannot change the "From Name:" text, "From Email:" text and "Subject:" text, they must be exactly as they currently are; after the "Subject:" text, you need a blank line to separate the body of the message.
This template file also works with wildcards:
- %friend_name% will be replaced with the friend name that the sender entered in your form
- %friend_email% will be replaced with the friend email that the sender entered in your form
- %sender_name% will be replaced with the sender name that the sender entered in your form
- %sender_email% will be replaced with the sender email that the sender entered in your form
For example, if the sender entered "John" as his name in the form, wherever you write %sender_name% in the email template will be replaced with "John" in the outgoing emails.
Download: