View Single Post
Old 02-05-2012, 12:11 PM  
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
i suck at this - help

can anybody tell me why this little contact form isn't working for me? i get 'Mail Error' when I submit the form.


PHP Code:
<?


$str="";
$str= "Name:".$_POST['txt_name']."<br><br>"."Email: ".$_POST['txt_email']."<br><br>Subject: ".$_POST['txt_subject']."<br><br>Message: <br>".$_POST['txt_msg'];
$to= '[email protected]' ;
$subject="Free Consultation Form";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '.$email . "\r\n";
$message =   $str;
mail($to,$subject,$message,$headers) or die("Mail Error");


if($_POST['chk_me']==1) {
    $to=  $_POST['txt_email'] ;
    $subject="Free Consultation Form";
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= 'From: '.$email . "\r\n";
    $message =   $str;
    mail($to,$subject,$message,$headers) or die("Mail Error");
    
}

header("Location:". $_SERVER['HTTP_REFERER']);

?>
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote