Web Analytics Made Easy -
StatCounter php error - CodingForum

Announcement

Collapse
No announcement yet.

php error

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • php error

    Hi, I'm new to the whole php world but I have a script that I'm having trouble with.

    I have a website with a contact form and I tested to see if the form would actually send the submitted info to my email but I get this error...

    Warning: mail(): Bad parameters to mail() function, mail not sent. in /home/content/g/o/l/goldenhills/html/email_us.php on line 62

    Here's the php code:

    <?php include "header.php"; ?>











    <table width="1000" border=0 align="center" cellpadding=5 cellspacing=0>

    <tr>

    <td width=150 background="images/bg_pix.jpg"></td>

    <td width=600 bgcolor=#FFFFFF>

    <?php

    // multiple recipients

    $to = get_db_setting('email_from') . "\r\n"; // note the comma

    // subject

    $subject = $_POST['subject'];



    // message

    //echo "$data[0]";

    $message = $_POST['message'];
    //$message = get_db_setting('email_text');


    // To send HTML mail, the Content-type header must be set
    // andy: NOT HTML email
    //$headers = 'MIME-Version: 1.0' . "\r\n";

    //$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";



    // Additional headers

    //$headers .= 'To: <$to>' . "\r\n";

    $headers .= 'From: ' . $_POST['emailFrom'] . "\r\n";

    // Mail it

    mail($to, $subject, $message, $headers);

    ?>

    <h2>Thanks!</h2>

    Email has been sent to:
    <?php echo nl2br($to); ?>



    </H2>

    </td>

    <td width=150 background="images/bg_pix.jpg"></td>

    </tr>

    </table>

    <body>

    <?php include "footer.php"; ?>

  • #2
    All of your headers and messages are commented out so they are never getting sent to the mail() function.
    PHP Code:
    <?php include "header.php"?>











    <table width="1000" border=0 align="center" cellpadding=5 cellspacing=0>

    <tr>

    <td width=150 background="images/bg_pix.jpg"></td>

    <td width=600 bgcolor=#FFFFFF>

    <?php

    // multiple recipients

    $to get_db_setting('email_from') . "\r\n"// note the comma

    // subject

    $subject $_POST['subject'];



    // message

    //echo "$data[0]";

    $message $_POST['message'];
    //$message = get_db_setting('email_text');


    // To send HTML mail, the Content-type header must be set
    // andy: NOT HTML email
    $headers 'MIME-Version: 1.0' "\r\n";

    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";



    // Additional headers

    $headers .= 'To: <$to>' "\r\n";

    $headers .= 'From: ' $_POST['emailFrom'] . "\r\n";

    // Mail it

    mail($to$subject$message$headers);

    ?>

    <h2>Thanks!</h2>

    Email has been sent to:
    <?php echo nl2br($to); ?>



    </H2>

    </td>

    <td width=150 background="images/bg_pix.jpg"></td>

    </tr>

    </table>

    <body>

    <?php include "footer.php"?>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

    Comment


    • #3
      That's nice to know.

      That doesn't help much.

      HOW DO I FIX IT?

      Comment


      • #4
        Did you even look at the code I posted?
        ||||If you are getting paid to do a job, don't ask for help on it!||||

        Comment


        • #5
          Originally posted by krizzone View Post
          That's nice to know.

          That doesn't help much.

          HOW DO I FIX IT?
          I don't think having a go at someone who is trying to help you is the best thing to do. Please have some manners for other people.
          -Jamie

          Comment


          • #6
            That's how I am. I'm straight to the point. What I said is straight to the point. It doesn't help me fix the problem. I'm a business man so I don't have time for feelings on some forum. I'm looking for an answer and if someone responds with the same problem I stated what good is that.

            Back to the error. Anyone have any ideas how to FIX it?

            Comment


            • #7
              Business men should know that treating people courteously is an exellent way to make business flourish. The term Business man is not synonymous with Arrogant Git, or at least it shouldn't be. You catch more flies with honey than vinegar. I'll think of some more cliches and post them later.

              Comment


              • #8
                You really should learn to pay attention more to detail. I told you exactly what your problem was. I even posted code that was TOTALLY different than the code you posted. Maybe you should hire someone to do things for you even though you get the help you needed you seem to have no idea what you are doing. Don't bite off more than you can chew.
                ||||If you are getting paid to do a job, don't ask for help on it!||||

                Comment


                • #9
                  "Hi, I'm new to the whole php world but I have a script that I'm having trouble with."


                  My first line should explain a lot unless you didn't read my very first line.

                  Comment


                  • #10
                    I still get the same error btw.

                    Comment


                    • #11
                      I for one am really looking forward to helping you.

                      Comment


                      • #12
                        Play nice, kids, before this thread gets closed.
                        Music Around The World - Collecting tips, trade and want lists, album reviews, & more

                        Comment


                        • #13
                          Why should I give a rat's arse about what a couple of ppl think on some forum? Forums aren't my life. I have "real" friends and "real" family in the "real" world.

                          I'm talking business here and I'm looking for a solution to my problem. Business isn't for crybabies. Either you can help me or you can't help me. Business ppl don't waste their time dealing with ppl that can't help them.

                          It's not arrogance, it's the business world. You're either an asset or you're not so stop spamming this thread if you can't help.

                          Do you really think this is the only php help forum out there? If I can't fix my problem here I'll just find another resource.

                          I'm not going to care what you think and you're opinions about personality. It's just a forum for God's sake.

                          Comment


                          • #14
                            a good starting point would be to echo out each of the paramaters being passed to mail(), do they look sensible?
                            My thoughts on some things: http://codemeetsmusic.com
                            And my scrapbook of cool things: http://gjones.tumblr.com

                            Comment


                            • #15
                              Until you can learn to be polite and courteous to other members who are trying to help this thread will remain closed. Last time I checked you haven't paid anyone here to help you. They have generously volunteered their time to help. So no this is not a business. And frankly if you ran a business and were rude to everyone like that you wouldn't stay in business very long because nobody would want to work with you.

                              And I was correct. It seems you are rude to other people who are trying to help you in other forums as well:

                              http://www.htmlcodetutorial.com/help/ftopic6296.html
                              http://www.htmlcodetutorial.com/help/ftopic6152.html
                              http://www.htmlcodetutorial.com/help/ftopic6270.html

                              I'd suggest an attitude adjustment.
                              Last edited by Spookster; Oct 4, 2006, 06:12 PM.
                              Spookster
                              CodingForum Supreme Overlord
                              All Hail Spookster

                              Comment

                              Working...
                              X