Menu

Email based on Form

Help
2009-08-02
2013-06-03
  • Lyndon Dunville

    Lyndon Dunville - 2009-08-02

    mail($_POST['field_2'],$mysubject,"phpFormGenerator - Form submission"," 

    That is what I have, The Form Information is sent to whatever Value they fill in the Email Field.  But, I want to have it so that I get a Copy of the Email sent to me as well.  So I would like to Change:

    mail($_POST['field_2'],$mysubject,"phpFormGenerator - Form submission"," 

    To

    mail($_POST['field_2'],blah@blah.com,$mysubject,"phpFormGenerator - Form submission"," 

     
    • TNTEverett

      TNTEverett - 2009-08-02

      You have the right idea but the mail() function looks for comma separated values so your example will confuse the mail() function by shifting in new values for fields that would reslut in unexpected behavior. 
      Try surrounding the two email addresses with quotes to keep the email addresses associated with the first {send to} field of the mail() function. 

       
    • Lyndon Dunville

      Lyndon Dunville - 2009-08-02

      Hello Everet,

      I've tried Moving around some Values around, like this.

      mail("$_POST['field_2'],dune44@t-and-a.host22.com",$mysubject,"phpFormGenerator - Form submission","

      And

      mail("$_POST['field_2']dune44@t-and-a.host22.com",$mysubject,"phpFormGenerator - Form submission","

      And

      mail(($_POST['field_2'],dune44@t-and-a.host22.com),$mysubject,"phpFormGenerator - Form submission","

      But It comes up with

      Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /example/example/example/form/tmp/persistent/Postulio Form/processor.php on line 8

       
      • TNTEverett

        TNTEverett - 2009-08-04

        I would have thought the first example would work.  I have examples with both comma separated addresses and semi-colon separated values. 
        Try creating a variable with both addresses first then put the variable in the first mail() field.

        $mailto=$_POST['field_2'].",dune44@t-and-a.host22.com";
        mail(($mailto,$mysubject,"phpFormGenerator - Form submission"," 

         
        • TNTEverett

          TNTEverett - 2009-08-10

          Correction:
          mail($mailto,$mysubject,"phpFormGenerator - Form submission"," 
          The double left bracket was a mistake. 

           
    • Lyndon Dunville

      Lyndon Dunville - 2009-08-10

      Thanks that worked.

      But

      In your Post, Not knowing if it was a Mistake or not, you put (( instead of (. after the 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.