The format for the mail statement is:
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
You have one too many parameters for your mail statement ($name)
If you don't have a copy of the php manual, you should download one.
Chris
chrishea
Nearly a Posting Virtuoso
1,429 posts since Sep 2008
Reputation Points: 210
Solved Threads: 230
Please test it:
<?php
$to = "****@***********.com";
$subject = "Contact Us";
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$message = $name . $_REQUEST['message'];
$headers = "From: $email";
if(@mail($to, $subject, $message, $headers))
{
echo "Your mail sent";
}
else
{
echo 'Error on sending';
}
?>
'@' return true or false!
mail function gets 4 options!
M0rteza
Junior Poster in Training
62 posts since Apr 2010
Reputation Points: 11
Solved Threads: 4