08.01.2012, 19:23
PHP код:
<?php
if (isset($_REQUEST['email']))
{
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail($email, "$subject",
$message, "From: you@domain.com");
echo "Thank you for contacting us!<br />We will try to answer your report.";
}
else
{
echo "<form method='post' action='mailform.php'>
Email: <input name='email' type='text' /><br />
Subject: <input name='Subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='Submit' name='submit' value='Send e-mail'/>
</form>";
}
?>
I think that you have placed the mail on the wrong place in the function.
http://php.net/manual/en/function.mail.php