I always use to use these codes in my site to send msgs.
In the step creat a page named contact.html and insert the following codes.
[HTML]<form method="POST" action="contact.php">
Fields marked (*) are required
<p>Name:
<input type="text" name="Name">
<p>Address:
<input type="text" name="Address">
<p>Phone:
<input type="text" name="Phone">
<p>Website:
<input type="text" name="Website">
<p>Comments:
<textarea name="Comments"></textarea>
<p><input type="submit" name="submit" value="Submit">
</form>[/HTML]
And after that creat another page called contact.php and paste following codes.
[PHP]<?php
$EmailFrom = "Server";
$EmailTo = "u@u.com";
$Subject = "Msg from server.....";
$Name = Trim(stripslashes($_POST['Name']));
$Address = Trim(stripslashes($_POST['Address']));
$Phone = Trim(stripslashes($_POST['Phone']));
$Website = Trim(stripslashes($_POST['Website']));
$Comments = Trim(stripslashes($_POST['Comments']));
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\n";
$Body .= "Website: ";
$Body .= $Website;
$Body .= "\n";
$Body .= "Comments: ";
$Body .= $Comments;
$Body .= "\n";
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
[/PHP]
And now in next step creat to pages called ok.hrml (type in this page that "Message was sucessfully send") and errot.html (type in this page that "Error occured while sending message")
Now opload it in ur site and test it.
you can use it in any way.