I'm pretty new to PHP and getting to grips with a (very simple) contact form. When I uploaded this to my hosting company, the PHP script does run as when I fill out and submit the form it brings back my confirmation but the email does not send. My hosting company is 123-reg. Do I have to do anything with them to allow the email to be sent?
My code is as follows:
Form Code:
<form action="action_handler.php" method="POST">
<dl>
<dt> Name:
<dd><input type="text" name="name">
<dt> Email Address:
<dd><input type="text" name="mail">
<dt> Comments:
<dd><textarea rows="5" cols "20" name="comment">
</textarea>
</dl>
<p><input type="submit"></p>
</form>
PHP Code:
<?php
$name = $_POST['name'];
$mail = $_POST['mail'];
$comment = $_POST['comment'];
$to = "someone@hotmail.co.uk";
$subject = "Contact Form Request";
$body = "You have a new message from: /n Name: $name /n Email: $mail /n/nThe request is as follows: /n/n $comment";
mail ($to,$subject,$body);
echo"<p>Thanks for your comment $name ...</p>";
echo"<p><i>$comment</i></p>";
echo"<p>We will reply to $mail</p>";
?>
Any help is much appreciated.