08.01.2012, 17:08
Can someone tell me what is wrong in this code:
When I press send e-mail it doesn't want to send e-mail even tho it says it is sent. And it doesn't return to the mailform if I didn't typed email, subject and message, it just says "Thank you for contacting us! We will try to answer your report." (its the message I placed in echo function). If anyone can help me I will +rep him
PHP код:
<?php
if (isset($_REQUEST['email']))
{
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail("you@domain.com", "$subject",
$message, "From:" . $email);
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>";
}
?>