Web Analytics Made Easy -
StatCounter E-Mail Form - CodingForum

Announcement

Collapse
No announcement yet.

E-Mail Form

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • E-Mail Form



    This is the e-mail form what I am using (the right hand boxes ect)

    But when I click on "Send" after filling out the fields, it dosnt send the the e-mail I have put in on the "formSubmit.php"

    Heres the code from inside the "formSubmit.php"

    Code:
    <?php
    
    $sendTo = "[email protected]";
    $subject = "Message from your website";
    
    $name = $_GET['Name'];
    $email = $_GET['Email'];
    $message = $_GET['Msg'];
    
    $headers  = "From: $name <$email> \r\n";
    //$headers .= 'MIME-Version: 1.0' . "\r\n";
    //$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $msg = "Name: ".$name."\n\nE-mail: ".$email."\n\nMessage: ".$message."";
    mail($sendTo, $subject, $msg, $headers);
    
    echo "sent=success";
    
    ?>

  • #2
    Check the mail() function to see if it failed and turn on all error reporting to make sure you see the error if there is one.

    Comment


    • #3
      Nope no errors are appearing....

      Comment


      • #4
        Did you turn on error reporting?

        Comment


        • #5
          I just clicked on "Check Page For Errors" in Dreamweaver...

          Comment


          • #6
            Anymore help guys?

            Comment


            • #7
              Spelled your variable wrong
              PHP Code:
              <?php

              $sendTo 
              "[email protected]";
              $subject "Message from your website";

              $name $_GET['Name'];
              $email $_GET['Email'];
              $message $_GET['Msg']; // you changed this variable....

              $headers  "From: $name <$email> \r\n";
              //$headers .= 'MIME-Version: 1.0' . "\r\n";
              //$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
              $msg "Name: ".$name."\n\nE-mail: ".$email."\n\nMessage: ".$message."";
              mail($sendTo$subject$message$headers); //<--- you change the top variable into message so you need to change it here also :)

              echo "sent=success";

              ?>

              Comment


              • #8
                Ahh great!

                So I can just overwrite the old coding with the one you just put up?

                Comment


                • #9
                  Nope, it still dosnt work when I put that code into the PHP file

                  Comment


                  • #10
                    To see where is the problem add following code do your formSubmit.php script so we will be able to check what variables it get from the form.
                    PHP Code:
                    If ($fp fopen($fp'output.log')) {
                      
                    fwrite($fpvar_dump($_REQUEST));
                      
                    fclose($fp);

                    p.s. I write that code here so it could contain some spelling errors. Create an empty file output.log file on the server and set permissions to 777 so the script will be able to write data inside.

                    Comment


                    • #11
                      Post your form....

                      Comment


                      • #12
                        http://www.speedyshare.com/598921728.html

                        I uploaded my formSubmit.php

                        @ PHP6

                        I havnt got a clue how to do the server thing you said mate

                        Comment


                        • #13
                          I meant the email form... the one with the send button.....

                          Comment


                          • #14
                            Ok that is not a problem there are lots of other solutions how to find the bug and fix it. The point is that I am always try to help topic starter to find the bug by own that is much better because he knows how to do research by own and fix the bug

                            So the second attempt will be just give us the URL where we can see that form you have posted in first post. I will check what data is sending with POST method and to which URL. That url http://www.speedyshare.com/598921728.html does not work any more I guess

                            Comment


                            • #15
                              Ok

                              Here is the website everything is on...

                              http://www.outsourcedjs.com

                              the part where talking about is under "Contact"
                              Last edited by Webbage; Apr 14, 2009, 10:37 PM.

                              Comment

                              Working...
                              X