|
Hi all,
I have a site for someone which uses a contact form to send enquiries via the mail() function with php and it is on a 1and1 shared host.
She says she receieves some mail frmo it but not others.
The form part of the contact page is this:
<form action="handleform.php" method="post" name="contact" onSubmit="MM_validateForm('contact_email','','RisE mail');return document.MM_returnValue">
<table>
<tr>
<td id="leftcol">Name:</td>
<td><input name="contact_name" type="text" size="30"></td>
</tr>
<tr>
<td id="leftcol">Email:</td>
<td><input name="contact_email" type="text" size="30"></td>
</tr>
<tr>
<td id="leftcol">Telephone:</td>
<td><input name="contact_telephone" type="text" size="30"></td>
</tr>
<tr>
<td id="leftcol">Enquiry:</td>
<td><textarea name="contact_enquiry" cols="30" rows="5"></textarea></td>
</tr>
<tr>
<td id="leftcol"> </td>
<td><input name="submit" type="submit" value="Submit"> <input name="reset" type="reset" id="reset" value="Reset"></td>
</tr>
</table>
</form>
and the php sections on handleform.php are:
<?php
// Creates fields from form data
$contact_name=$_POST['contact_name'];
$contact_email=$_POST['contact_email'];
$contact_telephone=$_POST['contact_telephone'];
$contact_enquiry=$_POST['contact_enquiry'];
// Creates email fields
$toaddress = 'xxx@xxx.com';
$subject = 'Website enquiry from website';
$mailcontent = 'Name: '.$contact_name."\n"
.'Email: '.$contact_email."\n"
.'Telephone: '.$contact_telephone."\n"
.'Enquiry: '.$contact_enquiry;
$fromaddress = 'From: '.$contact_email;
// Sends email
mail($toaddress, $subject, $mailcontent, $fromaddress);
?>
It appears that she does not receive every enquiry from customers that comes through the site form. Some enquiries come through and others don't. I have asked her to check her email spam folder and they are not going into that which makes me wonder if there is a problem with the form/host setup.
I also use the same code for forms on other websites that use 1and1 shared hosting and they seem to work fine (or at least I've had no reports or problems).
I just wondered if anyone has any ideas to this? Whether it is anything in that code, or if it is maybe a problem being on 1and1 shared hosting (which has the mail enabled working in phpinfo), or it could be the fact that the onSubmit action in the form (which uses the validate form behaviour in Dreamweaver) is having an effect? Or if anyone has any other ideas to try to make the mail submit better (I know mail() on its own is not always the best!)?
Many thanks
|