<?php
if ($send) {
if (empty($first_name) || empty($last_name)) {
echo "First name and last name is required";
} else {
/----- BELOW IS THE MESSAGE FORMAT -----/
$sendto = "your@domain.com";
$subject = "Your email subject";
$replyto = "reply@domain.com";
$message = "Place the message here and your variables to.
First Name: $first_name
Last Name: $last_name
"; // END MESSAGE FORMAT
mail("$sendto","$subject","$message","From:$replyto");
echo "Message sent";
}
} else {
?>
<form action="<?php echo "$PHP_SELF"?>" method="post">
First Name <input type="text" name="first_name" size="12"><br>
Last Name <input type="text" name="last_name" size="12"><br>
<input type="submit" name="send" value="Send Now">
</form>
<?php
}
?>
Copy and Paste and name it like send.php or whatever you want to call it.
If your server does not have register_global on, replace the following with the name you call this page:
<?php echo "$PHP_SELF"?>
This should get you started