This script will send the message submitted in the 'Message' box to the address entered in the 'eMail' field.
After the message has been sent the page will redirect to the index page.
The values are editable and could be changed to send the eMail to a specific address instead or both. The redirection could also point to a thank you page or similar.
The code for this page, 'eMail_form.php', is displayed below.
<fieldset><legend>Please enter your details</legend>
<form method="post" action="sendmail.php">
<p class="inside">eMail: </p><input name="email" type="text" /><br />
<p class="inside">Message: </p><br />
<textarea name="message" rows="15" cols="40" /></textarea><br />
<input type="submit" value="Submit" />
<input type="reset" />
</form></fieldset><!--Start Of Group-->
<!--Title Of Group-->
<!--Where To Send The Info-->
<!--eMail Field-->
<!--Message-->
<!--Message Field-->
<!--Submit Button-->
<!--Reset Button-->
<!--Close Form-->
<!--Close Group-->
The code for the processing form, 'sendmail.php', is displayed below.
<?php= ['email'];
= ['message'];
mail( "$email" ,"Feedback Form A8 : eMail Form",
$message, "From: $email" );
header( "Location: index.html" );
?>//Start Of PHP
//Request 'email' Data
//Request 'message' Data
//Where To Send The eMail
//Who The eMail is from
//Go Back To 'index.html'
//End PHP'