Hi
Im working on a really simple php form but i cant get it to send me the email :/ Can someone please look at this code and tell me whats wrong?
html on contact.html
php in mailer.php
Im working on a really simple php form but i cant get it to send me the email :/ Can someone please look at this code and tell me whats wrong?
html on contact.html
Code:
<form id="form2" method="post" action="mailer.php">
<fieldset>
<input id="con_name" type="text" name="name" value="Name:" alt=""/><br />
<input id="con_email" type="text" name="email" value="E-mail:" alt=""/><br />
<textarea id="con_mess" name="message" cols="0" rows="0">Message:</textarea><br />
<input type="submit" id="contact-submit" value="Send"/>
<input type="button" id="contact-clear" value="Reset"/>
</fieldset>
</form>
php in mailer.php
Code:
<?php
if(isset($_POST['send'])) {
$to = '[email protected]';
$subject = "Form Tutorial";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>