//$subject = "Test Subject";
//$message = "Test Message";
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$message=$_REQUEST['message'];
$headers = "From: $from_add \r\n";
$headers .= "Reply-To: $from_add \r\n";
$headers .= "Return-Path: $from_add\r\n";
$headers .= "X-Mailer: PHP \r\n";
$body = "Name: ".$name." \r\n";
$body .= "Email: ".$email." \r\n";
$body .= "Message: ".$message;
if(mail($to_add,$subject,$body,$headers))
{
$msg = "Thank you, mail sent.";
}
else
{
$msg = "Error sending email!";
}
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>PHP form</title>
</head>
<body>
<form action='<?php echo htmlentities($_SERVER['PHP_SELF']); ?>' method='post'>
Your name:<br>
<input name="name" type="text" value="" size="50"/><br>
Your email:<br>
<input name="email" type="text" value="" size="50"/><br>
Your message:<br>
<textarea name="message" rows="7" cols="38"></textarea><br>
<input type='submit' name='submit' value='Submit'>
</form>
<?php echo $msg ?>
</body>
</html>