Jump to content

[SOLVED] Input Submitted Email Address into Reply-to Field


Apryle

Recommended Posts

When a bride clicks "submit", the form at http://www.estesparkweddings.com/contactus.shtml generates an email to all association members.  When a member receives the email, he wants to click "reply" and have the email reply to the email address submitted with the form (variable $confirmemail).  Below is the code I'm using to try to do it.  Currently, when an email is received and I click "reply" it generates an email to $confirmemail@box73.bluehost.com.  Thanks in advance for any help.

 

<?php
// get posted data
$Name = Trim(stripslashes($_POST['Name'])); 
$Street1 = Trim(stripslashes($_POST['Street1'])); 
$Street2 = Trim(stripslashes($_POST['Street2'])); 
$City = Trim(stripslashes($_POST['City'])); 
$State = Trim(stripslashes($_POST['State'])); 
$Tel = Trim(stripslashes($_POST['Tel'])); 
$email1 = Trim(stripslashes($_POST['email1'])); 
$confirmemail = Trim(stripslashes($_POST['confirmemail'])); 
$zip = Trim(stripslashes($_POST['zip'])); 
$bride = Trim(stripslashes($_POST['bride'])); 
$groom = Trim(stripslashes($_POST['groom'])); 
$preferredDate = Trim(stripslashes($_POST['preferredDate'])); 
$alternateDate = Trim(stripslashes($_POST['alternateDate'])); 
$guests = Trim(stripslashes($_POST['guests'])); 
$beauty = Trim(stripslashes($_POST['beauty'])); 
$cakes = Trim(stripslashes($_POST['cakes'])); 
$cermonySites = Trim(stripslashes($_POST['ceremonySites'])); 
$consultants = Trim(stripslashes($_POST['constultants'])); 
$florists = Trim(stripslashes($_POST['florists'])); 
$gifts = Trim(stripslashes($_POST['gifts'])); 
$invitations = Trim(stripslashes($_POST['invitations'])); 
$limos = Trim(stripslashes($_POST['limos'])); 
$honeymoons = Trim(stripslashes($_POST['honeymoons'])); 
$music = Trim(stripslashes($_POST['music'])); 
$rentals = Trim(stripslashes($_POST['rentals'])); 
$photographers = Trim(stripslashes($_POST['photographers'])); 
$receptions = Trim(stripslashes($_POST['receptions'])); 
$videographers = Trim(stripslashes($_POST['videographers'])); 
$officials = Trim(stripslashes($_POST['officials'])); 
$ReferredBy = Trim(stripslashes($_POST['ReferredBy'])); 

// email body text
$Body .= "Name: " .$Name . "\r\n";
$Body .= "\r\n";
$Body .= "email1: " . $email1 . "\r\n";
$Body .= "Confirm Email: " . $confirmemail . "\r\n";
$Body .= "Telephone: " . $Tel . "\r\n";
$Body .= "Street1: " . $Street1 . "\r\n";
$Body .= "Street2: " . $Street2 . "\r\n";
$Body .= "City: " . $City . "\r\n";
$Body .= "State: " . $State . "\r\n";
$Body .= "zip: " . $zip . "\r\n";
$Body .= "Bride Name: " . $bride . "\r\n";
$Body .= "Groom Name: " . $groom . "\r\n";
$Body .= "guests: " . $guests . "\r\n";
$Body .= "Preferred Date: " . $preferredDate . "\r\n";
$Body .= "Alternate Date: " . $alternateDate . "\r\n";
$Body .= "Ceremony Location: " . $ceremony . "\r\n";
$Body .= "\r\n";
$Body .= "\r\n";

// set email parameters
$to      = 'apryle@allyourssolutions.com';
$subject = 'test info';
$headers = 'From: climberapryle@yahoo.com' . "\r\n" .
    'Reply-To: $confirmemail' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

// send email 
$success = mail($to, $subject, $Body, $headers);

// redirect to thank you page 
if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyou.shtml\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error2.shtml\">";
}

?>

Link to comment
Share on other sites

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.