Really strugling with sendmail.php please help
Hi All,
Please could anyone tell me why the following is not working ?
Ok firstly this is the text that makes up the form on the webpage:
<form action="sendmail.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<table class="form">
<tr>
<td style="height:26px"><input name="Name" type="text" value="Name"></td>
</tr>
<tr>
<td style="height:26px"><input name="E-mail" type="text" value="E-mail"></td>
</tr>
<tr>
<td style="height:26px"><input name="Phone" type="text" value="Phone"></td>
</tr>
<tr>
<td style="height:140px"><textarea name="Message" cols="0" rows="0">Message</textarea><br>
<br style="line-height:9px">
<div style="text-align:right">
<span><a href="head.office@mysite.co.uk" onClick="document.getElementById('form1').reset()">clear</a></span><img src="images/spacer.gif" alt="" width="10" height="1"><span><a href="head.office@mysite.co.uk" onClick="document.getElementById('form1').submit('form1')">send</a> </span></div>
</td>
</tr>
</table>
</form>
Ok secondly this is the text that makes up the sendmail.php file:
<?php
$to = 'head.office@mysite.co.uk';
$subject = 'Feedback form results';
// prepare the message body
$message = 'Name: ' . $_POST['Name'] . "\n";
$message .= 'E-mail: ' . $_POST['E-mail'] . "\n";
$message .= 'Phone: ' . $_POST['Phone'] . "\n";
$message .= 'Message: ' . $_POST['Message'];
// send the email
mail($to, $subject, $message, null, '-fhead.office@mysite.co.uk');
header('Location: http://www.mysite.co.uk/thankyou.html');
?>
I really have no idea why this is not working, when you fill out the form on the website and click the send button it just comes up with an error message, please can anyone help me ? My head is most confused now !!
Thankyou.
