Results 1 to 7 of 7

Thread: Contact Form Problem (

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Location
    Philadelphia
    Posts
    89

    Question Contact Form Problem (

    Hi guys,

    I'm pretty new to php and web development, so naturally I am asking for help with some basic stuff. I created a contact form with php script, and although the php script seems to be working fine( the echo message appears on the screen) I am not able to receive any emails using the form I created. Please look over my code, maybe you can figure out what is wrong with. As always any input is greatly appreciated.

    Thanks in advance.

    PHP Code:
    <?
    $subject="from ".$_GET['name'];
    $headers= "From: ".$_GET['email']."\n";
     $headers.='Content-type: text/html; charset=iso=8859-1';
     mail("[email protected]", $subject, "
     <html>
     <head>
      <title>Contact Letter</title>
     </head>
    <body>

    <br>
      ". "Name: " .$_GET['name']. "<br>" ."Email: " .$_GET['email']. "<br>" ."Message: " .$_GET['message']."
     </body>
     </html>" , $headers);
     
      echo ("Thank You.     Your message to [email protected] was succesfully sent!");
     ?>
     <script>
         //resizeTo(300,300)
     </script>

    and here is the html

    HTML Code:
      <div class="rtd">
        <div class="logo">
          <div class="col_2"><br />
              <div class="indent">
                <!--form id="form" action="" enctype="multipart/form-data"> -->
                <form id="form" action="contact.php" method="get"  target=”_blank” name="form" > 
                  <div class="b1">
                    <div>
                     <input name="name" type="text" value="  Name:" onfocus="this.value=''" />
                    </div>
                    <div>
                      <input name="email" type="text" value="  E-mail:" onfocus="this.value=''" />
                    </div>
                    <div></div>
                  </div>
                  <div class="b2">
                    <textarea name="message" cols="30" rows="40" onfocus="this.value=''">  Message:</textarea>
                    <br />
                    <div class="tar"><b>
                    <a href="#" onclick="getElementById('form').reset()">clear</a> <img src="images/spacer.gif" width="35" height="1" alt="qqq" /> 
                    <a href="#" onclick="getElementById('form').submit()">send</a></b></div>
                  </div>
                  <div class="clear"></div>
                </form>
              </div>
          </div>
        </div>

  2. #2
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: Contact Form Problem (

    Tried your sending code (though not your form) and it worked for me.

    Stupid question, but sometimes it's the answer: have you checked your "junk" folder at the email you're trying to send to?

    Do you know if your host requires authentication for sending emails?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Location
    Philadelphia
    Posts
    89

    Re: Contact Form Problem (

    Yes, that was the first thing I checked, the junk folder, but to no success.

    I am using yahoo for my host and after reading their policy it doesn't look like they are restricting the email sending by that much.

  4. #4
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: Contact Form Problem (


  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Location
    Philadelphia
    Posts
    89

    Re: Contact Form Problem (

    I think that refers to sending emails from your domain name.

  6. #6
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: Contact Form Problem (

    I'm not sure what you'll need to do here, but I think your problem is with the host. I've tried both your form and mailing code now, and it's sending emails just fine from my domain. :/

  7. #7
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Contact Form Problem (

    Quote Originally Posted by oleg View Post
    I think that refers to sending emails from your domain name.
    they would still be coming "from" your domain anyway -- the "from" field just wouldn't be your domain because you're saying it's from someone else. that doesn't matter though.

    your code looks fine, contact your host's support and ask them what's wrong.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width