Page 1 of 1

Contact php form not working

Posted: Fri Jan 30, 2009 3:05 pm
by highdemanddesign
I have a contact form that sends a user's information to an email. It is hosted through yahoo and they require that the FROM be from an address from our domain. When you submit the form, it says it sent successfully, but no email ever arrives. Is there something in this code i'm missing? Thanks for your help.

Code: Select all

 
<?
$subject="from ".$_GET['your_name'];
$headers= "From: angie@focusadmin.com";
 $headers.='Content-type: text/html; charset=iso-8859-1';
mail("angie@focusadmin.com", $subject,  "
<html>
<head>
 <title>Contact letter</title>
</head>
<body>
 
<br>
  ".$_GET['message']."<br>
   ".$_GET['your_name']."<br>
   ".$_GET['your_phone']."<br>
   ".$_GET['your_address']."<br>
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
<script>
    resizeTo(300, 300)
    //window.close()
</script>

Re: Contact php form not working

Posted: Fri Jan 30, 2009 3:07 pm
by Benjamin
You need new lines after the headers, that would be the first thing to fix:

Code: Select all

 
$headers = "From: angie@focusadmin.com\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
 
Also check the parameters of the mail function to verify they are correct.

Re: Contact php form not working

Posted: Fri Jan 30, 2009 3:48 pm
by highdemanddesign
That did it!! thank you thank you thank you!!