Jump to content

Reply to sender ( contact form )


Recommended Posts

what line of code should i add in order to be able to reply to the sender of contact form. right now its showing the last email created in the server.

 

heres the code

 

<?php

 

$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

 

// Checkbox handling

$field_1_opts = $_POST['field_1'][0].",". $_POST['field_1'][1];

 

mail("randy@reefsclub.com","Invitation - Form submission","Form data:

 

rooms: $field_1_opts

First Name: " . $_POST['fname'] . "

Last Name: " . $_POST['lname'] . "

Your Email: " . $_POST['email'] . " 

Phone Number: " . $_POST['pnumber'] . "

Request your arrival date: " . $_POST['field_2'] . "

Request your departure date: " . $_POST['field_3'] . "

Please send me an ownership package: " . $_POST['field_4'] . "

 

",$headers); include ("confirm.html");

 

?>

Link to comment
Share on other sites

You need to use headers. This is working code:

<?php

$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

// Checkbox handling
$field_1_opts = $_POST['field_1'][0].",". $_POST['field_1'][1];

$headers="Reply-To:".$_POST['email']."";

mail("randy@reefsclub.com","Invitation - Form submission","Form data:

rooms: $field_1_opts
First Name: " . $_POST['fname'] . " 
Last Name: " . $_POST['lname'] . " 
Your Email: " . $_POST['email'] . "  
Phone Number: " . $_POST['pnumber'] . " 
Request your arrival date: " . $_POST['field_2'] . " 
Request your departure date: " . $_POST['field_3'] . " 
Please send me an ownership package: " . $_POST['field_4'] . " 

",$headers); include ("confirm.html"); 

?>

 

Please try, does it work as supposed.

Link to comment
Share on other sites

i have not hand coded php. iam using an online service to create it. all i need for this to do is make me reply to the sender.

 

can u include the header that allows that. it would be a great help

ollifi provided that in his/her code

Link to comment
Share on other sites

What about this:

 

<?php

$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

// Checkbox handling
$field_1_opts = $_POST['field_1'][0].",". $_POST['field_1'][1];

$headers="From:".$_POST['email']."\r\nReply-To:".$_POST['email']."";

mail("randy@reefsclub.com","Invitation - Form submission","Form data:

rooms: $field_1_opts
First Name: " . $_POST['fname'] . " 
Last Name: " . $_POST['lname'] . " 
Your Email: " . $_POST['email'] . "  
Phone Number: " . $_POST['pnumber'] . " 
Request your arrival date: " . $_POST['field_2'] . " 
Request your departure date: " . $_POST['field_3'] . " 
Please send me an ownership package: " . $_POST['field_4'] . " 

",$headers); include ("confirm.html"); 

?>

Link to comment
Share on other sites

  • 1 month later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.