Below is a simple cut and paste solution for a Basic PHP E-mail form with form validation that will e-mail you from your web site. After submission it will confirm that the email has been sent.
Create a PHP file called mail.php or whatever you like (make sure the file extension is .php e.g. anything.php). Cut and paste the code below in the PHP file. This file contains the form and PHP code that validates and emails the form.
(customize the parts in CAPS to reflect your own information):
Code:
<!-- Cut code below this line -->
<?php
// Change below to the email address where you want to receive the message.
// (inside the quote marks 'receive@yourdomain.com'')
$myemail = 'RECEIVE@YOURDOMAIN.COM';
// Change this to the subject of your message.
// (inside the quote marks 'PHP Mail Form Subject'')
$subject = 'PHP MAIL FORUM SUBJECT';
if(mail($myemail, $subject, $message, $header))
{
$status = "Thank you for your Feedback!!<br><br>";
}
else
{
$status = "There was a problem sending your feedback, please try again later.<br><br>";
}
}
else
{
$status .= "<br>Please press <u>back</u> on your browser to resubmit.<br><br>";
}
}
// Now check the referer page and ensure it's a proper URL
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum