Jump to content

PHP Email - What am I doing wrong?


Ruggly

Recommended Posts

Here's my form:

 

<form name="contact" method="post" action="email.php" id="form">

        <div align="left">Name:

                <INPUT TYPE="text" NAME="name" SIZE="40">

                <br>

                <br>

            Phone:

                        <input type="text" name="phone" size="39">

          <br>

            <br>

            E-mail:

            <INPUT TYPE="text" NAME="email" SIZE="40">

            <br>

            <br>

            How can we help you:

            <SELECT NAME="need" SIZE="1">

              <OPTION SELECTED>Choose One...

                  <OPTION>Want to sell my home

                  <OPTION>Want to buy a home

                      <OPTION>Loan Information

                      <OPTION>Credit Repair

  <OPTION>Help! I'm in Foreclosure!

                          <OPTION>Other (see comments)

                        </SELECT>

            <br>

            <br>

            Please list the cities you are interested in:<br>

                        <textarea name="cities" rows=4 cols=50></textarea>            

          <br>

  Comments:<br>

                        <textarea name="comments" rows=4 cols=50></textarea>

<br>

         

         

            <INPUT TYPE="submit" name="esubmit" value="Send" style="cursor:pointer">

            <INPUT TYPE="reset" value="Clear">

        </div>

    </form>

 

 

Here's my php process:

 

<script type="text/javascript">

<!--

function delayer(){

    window.location = "http://www.hr-realestate.info"

}

//-->

</script>

</head>

 

<body onLoad="setTimeout('delayer()', 5000)">

<?php

 

  //Some variables

  $mymail = "[email protected]";

  $name = $_POST['name'];

  $phone = $_POST['phone'];

  $email = $_POST['email'];

  $need = $_POST['need'];

  $cities = $_POST['cities'];

  $comments = $_POST['comments'];

 

  //Mail Processing

  if ($_POST['esubmit']) {

   

      $body = "Name: " . $name;

  $body .= "\nEmail: " . $email;

  $body .= "\nPhone: " . $phone;

  $body .= "\nCities: " . $cities;

  $body .= "\n\n" . $comments;

 

      mail($mymail,$need,$body,"From: $name <$email>");

      echo "<p>Thank you! Someone will contact you shortly. <br><br>";

      echo "You will be redirected back to our homepage in a few seconds.";

      echo "</p>";

    }

 

 

?>

</body>

 

 

 

Does the code look right?  I'm not getting any emails with this

Link to comment
https://forums.phpfreaks.com/topic/63221-php-email-what-am-i-doing-wrong/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.