Menu

Email a form to 2 addresses

Help
EoinDubh
2011-12-03
2013-06-03
  • EoinDubh

    EoinDubh - 2011-12-03

    How do I send a completed for to 2 different email addresses?

     
  • EoinDubh

    EoinDubh - 2011-12-03

    I have tried the format mail("address1@my.org,address2@my.org","Form Submitted at your website",$message,"From: phpFormGenerator"); and get an error message that says:
    500 Server Error
    A misconfiguration on the server caused a hiccup. Check the server logs, fix the problem, then try again. URL: http://www.clan-donald-usa.org/forms/use/Membership/process.php

     
  • danitec

    danitec - 2011-12-03

    You must do this with two lines:
    ("address1@my.org","Form Submitted at your website",$message,"From: phpFormGenerator");
    ("address2@my.org","Form Submitted at your website",$message,"From: phpFormGenerator");

     
  • TNTEverett

    TNTEverett - 2011-12-03

    Although 2 lines will work, it is not necessary.  You can follow the examples 2 and/or 4 from this link.  I have used this method to send a message to as many emails as I desire. 
    http://php.net/manual/en/function.mail.php

     
  • EoinDubh

    EoinDubh - 2011-12-04

    danitec,

    That is what I tried first. It got the same error.

     
  • TNTEverett

    TNTEverett - 2011-12-04

    Then you likely created a PHP syntax error which prevents the file from executing. 

     
  • danitec

    danitec - 2011-12-04

    does it works with one line?
    Each Line must start with mail
    mail ("address1@my.org","Form Submitted at your website",$message,"From: phpFormGenerator");
    mail ("address2@my.org","Form Submitted at your website",$message,"From: phpFormGenerator");

     
  • TNTEverett

    TNTEverett - 2011-12-04

    "Although 2 lines will work, it is not necessary.  You can follow the examples 2 and/or 4 from this link.  I have used this method to send a message to as many emails as I desire. 
    http://php.net/manual/en/function.mail.php
    "

    There are literally 100's of examples of doing this.  PHP.net is an authority on PHP and the syntax they provide comes straight from the PHP standard.  Examples may or may not be tested but I assume they have been reviewed for accuaracy before they are provided. 
    I have used this method and it does work.  I did note that ALL the examples have a space after commas and that yours does not.  Try the space after the comma. 
    You can also test a simple PHP file like this.
    <?php
    mail("email1@domain.com, email2@domain.com",Test","This is a test.");
    ?>

    Even using the same email twice should result in two copies of the same email. 

     
  • EoinDubh

    EoinDubh - 2011-12-04

    I downloaded the current version 2.09 and installed it to the site. I created a form with 18 fields and set it to email it to only me. I have not touched any of the files after the install. I have double checked that the forms directory and all files are set to 777.  I get the same error when I try to submit the form.

     
  • TI99er

    TI99er - 2011-12-04

    I have used phpFormGenerator for some time now and the way I get around the email issue, and the database issue, is to use a program called Form Tools (http://www.formtools.org). It works great in conjunction with phpFormGenerator and you can have as many people as you want to receive emails in it as you want. Plus it really does a nice job of adding any submission from the form into a database. Plus you can send a confirmation response to the person submitting the form. It works great and I highly recommend it.

     

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.