Menu

How to have the person's email for the reply.

Help
2009-03-25
2013-06-03
  • Aaron Hardy

    Aaron Hardy - 2009-03-25

    I used this for a lot of my sites, I just have one problem. I referred someone to this script and they liked it...only problem they're having trouble understanding they have to copy the email and start a new one.

    I just want to know what code do I have to enter to make people's emails as the reply email instead of my system email.

    This is perfect for my website, but I also host one website under my current hosting account and I set them up one and it has the same system email.

    If this could be done, I'd be very happy and continue to refer your guys form to people.

    Thanks,

    Ace

    This is probably the most useful script for people who own websites.

     
    • Aaron Hardy

      Aaron Hardy - 2009-03-25

      <?php

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

      mail("email@email.com","phpFormGenerator - Form submission","Form data:

      Type of Quote: " . $_POST['field_1'] . "
      Full Name: " . $_POST['field_2'] . "
      Company: " . $_POST['field_3'] . "
      Address: " . $_POST['field_4'] . "
      City: " . $_POST['field_5'] . "
      State: " . $_POST['field_6'] . "
      Phone Number: " . $_POST['field_7'] . "
      E-mail Address: " . $_POST['field_8'] . "
      Best time to call: " . $_POST['field_9'] . "
      Comments: " . $_POST['field_10'] . "
      Type of  Service: " . $_POST['field_11'] . "

      powered by phpFormGenerator.
      ");

      include("confirm.html");

      ?>

      Where and what would I add to make the persons email come up as the reply in a email.

       
      • TNTEverett

        TNTEverett - 2009-03-25

        Not that I approve, but here it is!

        mail(
        $_POST[field_8]
        ,"phpFormGenerator - Form submission","Form data:

        Consider this:
        Someone detects that they can send anyone an email anonymously by filling your form and putting anyone'e email address in the "send to" field. 

         
    • TNTEverett

      TNTEverett - 2009-03-25

      Use a more formal set of variables for every field in the mail() function.
      See the following examples:
      mail($recipient, $subject, $mail_body, $header);

      Find this on this link:
      http://www.php.net/mail

       
    • Aaron Hardy

      Aaron Hardy - 2009-03-25

      I got a error

       
    • Aaron Hardy

      Aaron Hardy - 2009-03-25

      Oh, my email was left out.

       
    • Aaron Hardy

      Aaron Hardy - 2009-03-25

      Nevermind, I fixed it. Thank you for the help. I need to learn php and I will look into your advice.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.