Menu

Send recipient an email

Help
Bogroll
2005-10-06
2013-06-03
  • Bogroll

    Bogroll - 2005-10-06

    Hi, I've just set up an enquiry form and it all works great, sending the enquiry to the site owner with details entered by the user.

    My question: what code would I use to send a thankyou email to the user (the variable for user's email address is 'email')

    Can anyone help please?

    Thanks

     
    • TNTEverett

      TNTEverett - 2005-10-06

      Something like this right below the email sent to the form owner:

      /*Adding thankyou code here*/

      $message="Whatever message you want to send";
      mail($email,"Thank You Subject Line",$message,"From: you@yourdomain.com");

      /*End of thank you code*/

      Sending you an example process_w_thankyou.php file.

       
    • Bogroll

      Bogroll - 2005-10-06

      Thankyou - I will give it a go :)

       
    • Bogroll

      Bogroll - 2005-10-06

      Hi - I can't get it to send the email: I have sent you a copy of my code

      Thanks

       
    • TNTEverett

      TNTEverett - 2005-10-06

      Your original email said the variable name was 'email'.  According to your code the variable is 'Email'. 

      Make this change:

      mail($Email,"Thank You Subject Line",$message,"From: you@yourdomain.com";);

       
    • Bogroll

      Bogroll - 2005-10-06

      Thanks - that was it - it works great now!!

      Thanks again!!

      :)

       
    • paulabakerparkin

      I would like to be able to do the same, can you point me in the right direction?

       
      • TNTEverett

        TNTEverett - 2005-11-19

        If you can't follow the thread to accomplish what you want, you will have to send me more information on what you have and what you want. 

         
    • pheelup

      pheelup - 2005-11-25

      Hi,

      I am looking to do the same thing.  Could either of you send me the process_w_thankyou.php file?  Also, would this work if I want to send the email in HTML format?

       
    • TNTEverett

      TNTEverett - 2005-11-25

      In this thread there are instructions for doing what you want.  If you can't follow the thread to accomplish what you want, you will have to send me more information on what you have and what you want.

       
    • ajoaquin72

      ajoaquin72 - 2005-12-14

      I understand how to do this, thanks! But exactly what do I put into the message body of the email to display the information the formuser entered? I was guessing I could look at the body of the thank you page.

      If I'm correct, then I am close to getting it. But I don't know exactly where to begin and where to stop copying. Should I send you a copy of my process.php?

      Thanks in advance :)

       
      • TNTEverett

        TNTEverett - 2005-12-15

        Duplicating the email that is sent to the form admin and having it sent to the form user is a simple addition to the process.php file.  Anything else would be more extensive customization.  I helps to know both html and php when attempting to make modifications at this level. 
        From you addition to this post it is unclear exactly what you are attempting to do but if all you want is to send the user the same email as the admin, this should be a very simple change. 

         
        • JoFo

          JoFo - 2008-05-28

          Can i get the code on how to "Duplicating the email that is sent to the form admin and having it sent to the form user is a simple addition to the process.php file."?

          I have the form all set up, i just want to have the form answers sent to the form user as well.

          thanks

          jonphifom

           
          • TNTEverett

            TNTEverett - 2008-05-28

            $email1= "some value";
            $email2= "some value";

            $to="\"".$email1.";".$email2."\"";

            Where $email[N] can be either someone@somedomain.com or $_POST['field_1'] when field_1 is the variable from your for that is the email address you want to send to. 

            mail ( $to , $subject , $message )

            http://www.php.net/function.mail

             

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.