If you have Linux based hosting, make a html form like:
CODE
<form action="mailer.php" method="post">
Name:
<br>
<input type="text" name="name">
<br>
Your Email:
<br>
<input type="text" name="email">
<br>
Your comments:
<br>
<textarea cols="10" rows="10" name="comments"></textarea>
<br>
<input type="submit" name="submit">
</form>
and put it in you html page.
next, create a new file named "mailer.php" with the follow php script:
CODE
<?php
// Mail destination, put your email here:
$to = "yourmail@yourdomain.com";
// SUBJECT:
$subject = "The subject of the email";
$from = $_POST['email']; // Email from the form
// BODY
$msg .= "\nName: ".$_POST['name']; // Name from the form
$msg .= "\nComment: ".$_POST['comments']; //Comment from the form
// Mail Header (No touch it)
$header.= "From: ".$from."\r\n";
$header.= "Reply-To: ".$from."\r\n";
$header.= "X-Mailer: PHP/" . phpversion();
// ---------------------------
if(mail($to , $subject , $msg, $header))
{
// Redirection to the "Thank you" page if the operation was succesfull.
header("Location:thankyou.html");
}
else
{
// Redirection to the Error page If can't send.
header("Location:error.html");
}
?>
summary: Create this two files, put them in your public_html folder an access the html form file with your browser like
http://yourdomain.com/themailform.htmlif you want you can change customize the look & feel, add the html code in your existing webpage, and change the form's flield's (remember edit the mailer.php for match the new var's names) and you can do what you want.
enjoy.