PHP-based Form Mail (Feedback) Script
Posted by Ryan D, Last modified by Jitin S on 11 February 2016 09:06:13 PM
Using a PHP script, you may accept feedback from your website visitors and get the results emailed to you. You can use the sample script provided by us and tweak it a bit to suit your requirements.
You would need to change the email address in the field $from to any email address on the domain name on which you are incorporating this script.
If your domain name is yourdomain.com, then you would define the From email address as firstname.lastname@example.org.
This email address need not be existing on the mail server of yourdomain.com; however, the domain name in the $from field has to be yours.
You may use an email address such as Do_Not_reply@yourdomain.com.
The value in the $mailto field needs to be changed to the email address, where the email containing the data submitted through the form needs to be delivered.
In an attempt to keep a check on abuse from our Hosting Servers, the following conditions have been set for mail scripts on our Linux Hosting Servers:
Once the visitor provides feedback, he/she can then be re-directed to another page on your website. In order to achieve this, you need to mention the path to the HTML file in the $file field in the script. Alternatively, you can display a message to the visitor thanking him/her for the feedback. Such messages can be displayed in a new page like thanks.htm. Such a page can also contain other information as deemed necessary.
$subject = "Mail from Enquiry Form";
$pstr = $pstr."$key : $val \n ";
$gstr = $gstr."$key : $val \n ";
if ($pcount > $gcount)
You can refer our short screencast too: