Menu

Mail address is from the server

Help
2007-06-11
2013-06-03
  • Murray Mintz

    Murray Mintz - 2007-06-11

    The form works perfectly but when it sends mail the from address which the recipient receives, inserts the address as as the following:
    From: phpFormGenerator@myhostingcompany.com.

    I want it to say something like gift@mydomain.com  Where do I change the code to resolve this problem?
    thanks,

     
    • TNTEverett

      TNTEverett - 2007-06-11

      In the process.php file you will find a line that looks like this,
      mail($dbemail,"Form Submitted at your website",$message,"From: phpFormGenerator");

      Create a line just above this one like this,
      $emailfrom="From: gift@mydomain.com";

      Then change the mail function line to this,
      mail($dbemail,"Form Submitted at your website",$message,$emailfrom);
      Ignoring everything else in my example mail function, you are only changing the last portion of your mail function.

       
    • jsherk

      jsherk - 2007-06-11

      Are you saying that the email that YOU receive has the above email address in it? I think the phpFormGenerator will only send to one email address (and always to the same email address), unless you modify the code manually. It should always come to you (to the email that you specified). Your

      If you go to the folder where your form is (originally it is in the /USE folder), and open up the process.php file.

      Look for the line that says:

      mail("phpFormGenerator@myhostingcompany.com","Form Submitted at your website",$message,"From: phpFormGenerator");

      You can change the email address it comes from [phpFormGenerator@myhostingcompany.com], the subject of the email [Form Submitted at your website], and who it's from [From: phpFormGenerator].

       
      • TNTEverett

        TNTEverett - 2007-06-11

        Don't confuse the issue.  The poster masterwebman asked how to change the "From:" email address.

        The mail function has the following syntax:
        mail ( string $to, string $subject, string $message [, string $additional_headers [, string $additional_parameters]] )

        The $additional_headers, or fourth field, is where to specify the "From:" email address.  By default the phpFormGenerator inserts the following "From:" field:
        "From: phpFormGenerator"
        When the web host sends this email it may, or may not, append the domain name to the message such that, when received, the message appears to come from "phpFormGenerator@domainname". 
        This is the issue being addresses and the instructions are correct. 

         
    • Murray Mintz

      Murray Mintz - 2007-06-13

      thanks,
      The code line was not the same,
      mail("gift@mysite.com","Form Submitted at your website",$message,"From: phpFormGenerator");
      I then replaced the defaul from: phpformgenerator... to my email address and it correct now.
      Thanks very much

       
    • darpiano

      darpiano - 2007-08-02

      A form has a field "email address." I want the data entered in that field to populate the From field on email sent by phpFormGenerator. Is that possible?

       
      • TNTEverett

        TNTEverett - 2007-08-02

        If you are using the generator version 2.09 the following is true:

        In the process.php file you will find a line that looks like this,
        mail($dbemail,"Form Submitted at your website",$message,"From: phpFormGenerator");

        Create a line just above this one like this,
        $emailfrom="From: gift@mydomain.com";

        Then change the mail function line to this,
        mail($dbemail,"Form Submitted at your website",$message,$emailfrom);
        Ignoring everything else in my example mail function, you are only changing the last portion of your mail function.

        Had you read the remainder of the thread you posted on your would have found this exact text. 

         

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.