Hello,
I have a contact form that is not working. It just keeps providing the failed delivery message specified in the contact. php file. Any help would be much appreciated.
Thanks,
<?php
$field_department = $_POST['cf_department'];
$field_message = $_POST['cf_message'];
$mail_to = 'blah@blah.com';
$subject = 'Website Feedback';
$body_message .= 'Addressed to: '.$field_department."\n";
$body_message .= 'Message: '.$field_message;
$mail_status = mail($mail_to, $subject, $body_message);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for your feedback.');
window.location = 'contact.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to blah@blah.com');
window.location = 'contact.html';
</script>
<?php
}
?>
------------------------------------------------
<form action="contact.php" method="post">
<ol><li>
</li><li>
<label for="department">Addressed to:</label>
<input type="text" name="cf_department" class="text" />
</li><li>
<label for="message">Your Message:</label>
<textarea name="cf_message"rows="10" cols="50"></textarea>
</li><li>
<input type="submit" value="send" /><input type="reset" value="Clear"/>
<div class="clr"></div>
</li></ol>
</form>