Problem with 'Reply-To' on PHP contact form...
hi guys,
i've created php contact form works perfectly; except, when receive email inbox , go reply it, doesn't reply email address of person submitted form - in reply field appears have default server email address.
here's code have included in same php page form:
<?php if (array_key_exists('submit', $_post)) { $name = $_post['name']; $email = $_post['email']; $formmessage = $_post['message']; if (empty($name)) { $warning['name'] = "please provide name"; } if (empty($email)) { $warning['email'] = "please provide email address"; } if (empty($formmessage)) { $warning['message'] = "please type message"; } $headers .= "reply-to: " . $_post["email"] . "\r\n"; $to = "me@myemail.com"; $subject = "enquiry website"; $message = $headers; $message .= "name: " . $_post["name"] . "\r\n"; $message .= "e-mail: " . $_post["email"] . "\r\n"; $headers = "mime-version: 1.0\r\n"; $headers .= "content-type: text/html; charset=iso-8859-1\r\n"; $message= " <table cellspacing='0' cellpadding='8' border='0' width='500'> <tr> <td colspan='2'></td> </tr> <tr bgcolor='#eeeeee'> <td width='154' style='font-family:verdana, arial; font-size:11px; color:#333333;'><strong>name</strong></td> <td width='314' style='font-family:verdana, arial; font-size:11px; color:#333333;'>".$name."</td> </tr> <tr bgcolor='#eeeeee'> <td style='font-family:verdana, arial; font-size:11px; color:#333333;'><strong>e-mail address:</strong></td> <td style='font-family:verdana, arial; font-size:11px; color:#333333;'>".$email."</td> </tr> <tr bgcolor='#eeeeee'> <td colspan='2' style='font-family:verdana, arial; font-size:11px; color:#333333;'><strong>message</strong></td> </tr> <tr bgcolor='#eeeeee'> <td colspan='2' style='font-family:verdana, arial; font-size:11px; color:#333333;'>".$formmessage."</td> </tr> <tr><td colspan='2' style='padding: 0px;'></td></tr> </table> "; $url = stripslashes($_post["url"]); if (!empty($url)) { header( 'location: http://www.go-away-spam-robots.com' ); exit(); } if (!isset($warning)) { mail($to, $subject, $message, $headers); header( 'location: http://www.mydomain.com/thankyou.php' ) ; } } ?>
can see code why happening?
thank , hope hear you!
sm
sorted!
i removed...
$headers .= "reply-to: " . $_post["email"] . "\r\n";
...and added...
$headers = "mime-version: 1.0\r\n";
$headers .= "content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "reply-to: " . $_post["email"] . "\r\n";
More discussions in Dreamweaver support forum
adobe
Comments
Post a Comment