buddhapi Posted April 3, 2012 Share Posted April 3, 2012 Can someone assist with this, the form works, but the end user cannot simply click on reply, they have to copy/paste. I think it is just a header issue, but i'm not sure and the person who wrote this script is no longer availalble...any help would be much appreciated! <?php if ($_POST['post'] != '') { $to = '[email protected]'; $subject = 'Appointment Request'; $message = "A user on the website has submitted an appointment request. Find their details below.\n\n"; $reqd = array('name', 'email', 'phone', 'phonetype1', 'petname'); $disregard = array('post', 'Appointment_Mail_'); $breaks = array('break', 'break2', 'break3'); foreach($_POST as $key=>$value) { if (in_array($key, $reqd) && $value == '') { $error .= '- Fill out '.$key.'<br />'; } elseif (!in_array($key, $disregard)) { if (in_array($key, $breaks)) { $message .= "\n"; } else { $message .= ucwords($key).": ".stripslashes($_POST[$key])."\n"; } } } if ($error == '') { mail('[email protected]', $subject, $message, 'From: domain.com <[email protected]>'); header('Location: http://www.domain.com/thanks.html'); die(); } else { $error = 'Please correct the following errors:<br />'.$error; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/260296-reply-to-header/ Share on other sites More sharing options...
btherl Posted April 3, 2012 Share Posted April 3, 2012 The "From" address is specified as [email protected]. If you want them to be able to reply then that should be the address you want them to reply to. Edit: Or, you can use a reply-to header. There is an example here: http://php.net/manual/en/function.mail.php Quote Link to comment https://forums.phpfreaks.com/topic/260296-reply-to-header/#findComment-1334161 Share on other sites More sharing options...
buddhapi Posted April 3, 2012 Author Share Posted April 3, 2012 Thanx for the fast reply, perhaps I wasn't clear enough, the end user ( recipient) wants to be able to hit reply and have it reply to the email address that was entered into the form from the visitor, so in essence the address will always be different . I have read the header documentation about 377 times now, and it's still not sinking into my thick head. Quote Link to comment https://forums.phpfreaks.com/topic/260296-reply-to-header/#findComment-1334163 Share on other sites More sharing options...
btherl Posted April 3, 2012 Share Posted April 3, 2012 Ok, how about this: mail('[email protected]', $subject, $message, "From: domain.com <[email protected]>\r\nReply-To: {$_POST['email']}"); Then someone clicking "Reply" after receiving this email should have the reply sent to the email address entered in the form.. is that what you are looking for? Quote Link to comment https://forums.phpfreaks.com/topic/260296-reply-to-header/#findComment-1334165 Share on other sites More sharing options...
buddhapi Posted April 3, 2012 Author Share Posted April 3, 2012 I'll give it shot, looks to be the answer, you're the best!! Thanx a bunch! Quote Link to comment https://forums.phpfreaks.com/topic/260296-reply-to-header/#findComment-1334171 Share on other sites More sharing options...
buddhapi Posted April 3, 2012 Author Share Posted April 3, 2012 Worked perfectly!! thanx again! Quote Link to comment https://forums.phpfreaks.com/topic/260296-reply-to-header/#findComment-1334174 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.