Menu

Change From Email Address

Help
Anonymous
2010-03-17
2013-06-03
  • Anonymous

    Anonymous - 2010-03-17

    I get the results of the form, but would like it to come from the person's email address that is required for them to enter.  I was able to do this a few years ago when I used phpformgenerator, but can't get it to work with this newer version.  The email address field I am using is:

    Step 2: General Info: Email Address: " . $_POST . "

    So i was tying to change this line of code to insert that email field:

    mail("clearpixeldesign@gmail.com","NFNP Boats Form Submission",$message,"From: . $_POST . ","Form data:

    But that's not working for me.  Do you know what I'm doing wrong or missing?

    Thanks.

     
  • John W.

    John W. - 2010-03-17

    Use:

    $from_email = $_POST;
    $headers = 'From: ' . $from_email . "\r\n" .
    'Reply-To: ' . $from_email;
    mail("clearpixeldesign@gmail.com","NFNP Boats Form Submission","Form data:

    …..and don't forget to add $headers in the code. I always put it at the end of the mail contents:

    powered by powered by phpFormGenerator.
    ",$headers);
    include("confirm.html");

     
  • John W.

    John W. - 2010-03-17

    Disregard the previous reply. It did not post correctly. Something about the BB Code doesn't work right in the forum.

    Use:

    mysql_close($link);

    $from_email = $_POST;
    $headers = 'From: ' . $from_email . "\r\n" .
    'Reply-To: ' . $from_email;
    mail("clearpixeldesign@gmail.com","NFNP Boats Form Submission",
    "Form data:

    And don't forget to add $headers in the code. I always put it at the end of the mail contents:

    powered by phpFormGenerator.
    ",$headers);
    include("confirm.html");

     
  • John W.

    John W. - 2010-03-17

    It still left off the field number after $_POST;  That should be field 17 just like you have it in your post. I don't know why I can't get everything to appear in the posts tonight.

    $from_email = $_POST;

     
  • Anonymous

    Anonymous - 2010-03-17

    Thank you.  I'm getting a parse error now for the line where I added the headers, this is what it looks like after the last line of form data:

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

    ?>

     
  • John W.

    John W. - 2010-03-18

    The extra chracters you have above the line should not be there.

    powered by phpFormGenerator.
    ",$headers); include("confirm.html");

     
  • Alyssa Winfield

    Alyssa Winfield - 2010-05-08

    Hi There, I'm trying to follow your instructions on this, because this is what I'm trying to do.  I am very limited in PHP and I don't understand where I am supposed to paste this, or exactly what needs to be pasted.  Can you help me out?  Maybe in order to get the code to paste correctly you should use this method:

       
    [code]   
    Paste code here between the code and end code, then it won't get chopped up in the 
    post.
    [/code]
    
     

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.