Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Jan 2003
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sending Mail In PHP, Error (Failed To Receive), what does that mean?

    I keep getting this error when I attempt trying to send a "Home Request"

    arning: mail(): Failed to Receive in C:\Documents and Settings\l3vi\My Documents\Web Documents\Projects\Server User Interface\Paula Osborne\Functions\send.php on line 26
    Due An Error, Your Home Request Could Not Be Sent!

    Here is my Code (this first one is send.php)
    PHP Code:
    <?php
     
    if($_POST['type'] == "Home Request"){

      
    $to $_POST['to'];
      
    $from $_POST['from'];
      
    $subject "Test!";
      
    $message "Name: $from\nCurrent Address: $_POST[address]\nCity: $_POST[City]\nState: $_POST[State]\nZip: $_POST[Zip]\n\nHome Phone: $_POST[Phone1]\nWork Phone: $_POST[Phone2]\nEmail: $_POST[Email]\n\nRelocation Date: $_POST[DTE]\nBeds: $_POST[beds]\nBaths: $_POST[baths]\nSquare Feet: $_POST[sf]\nPrice Range: $_POST[PR]\n";

     }elseif(
    $_POST['type'] == "Email"){

      
    $to $_POST['to'];
      
    $from $_POST['from'];
      
    $subject $_POST['subject'];
      
    $message $_POST['message'];

     }
    ?>
    <center>
     <font size="5pt">
       <b>Sending <?php echo $_POST['type']; ?>...</b>
     </font>
    </center>
    <br />
    <center>
     <?php
        $sent 
    mail("$to","$subject","$message","From: $from");
        if(
    $sent){
           echo 
    "Your $_POST[type] Was Successfully Sent!";
        }else{
           echo 
    "Due An Error, Your $_POST[type] Could Not Be Sent!";
        }
     
    ?>
    Here is my code for the form:

    Code:
    <center>
     <font size="5pt">
       <b>Request a Home (UNDER CONSTRUCTION)</b>
     </font>
    </center>
    <br />
    
    <div class="cntrp">
    <form action="./index.php?page=functions.send" method="POST">
     <div class="emlfrm">
      <input type="hidden" name="type" value="Home Request">
      <input type="hidden" name="to" value="paula.osborne@coldwellbanker.com">
      <b>Your Name</b>: <input type="text" name="from" value="Your Name" style="width:199px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Current Address</b>: <input type="text" name="address" value="Address" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>City</b>: <input type="text" name="City" value="City" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>State</b>: <input type="text" name="State" value="State" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Zip</b>: <input type="text" name="Zip" value="Zip" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Home Phone</b>: <input type="text" name="Phone1" value="555-555-5555" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Work Phone</b>: <input type="text" name="Phone2" value="555-555-5555" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Your Email</b>: <input type="text" name="Email" value="yourname@yourname.com" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Relocation Date</b>: <input type="text" name="DTE" value="MM/DD/YY" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Beds</b>: <input type="text" name="beds" value="# of Beds" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Baths</b>: <input type="text" name="baths" value="# of Baths" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Square Feet</b>: <input type="text" name="sf" value="# of Square Feet" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Price Range</b>: 
    <select name="PR">
      <option value="1">$0 - $40,000
      <option value="2">$41,000 - $80,000
      <option value="3">$81,000 - $120,000
      <option value="4">$121,000 - $160,000
      <option value="5">$161,000 - $200,000
      <option value="6">$201,000 - $240,000
      <option value="7">$241,000 - $300,000
      <option value="8">Above $300,000
    </select>
    <br />
      <br />
      <input type="submit" value="Email Me!">
      
     </div>
    </form>
    </div>
    And here is the code for the email me form:

    Code:
    <center>
     <font size="5pt">
       <b>Email Me</b>
     </font>
    </center>
    <br />
    
    <div class="cntrp">
    <form action="./index.php?page=functions.send" method="POST">
     <div class="emlfrm">
      <input type="hidden" name="type" value="Email">
      <b>To</b>: paula.osborne@coldwellbanker.com<input type="hidden" name="to" value="paula.osborne@coldwellbanker.com"><br />
      <b>From</b>: <input type="text" name="from" value="yourname@youremail.com" style="width:199px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Subject</b>: <input type="text" name="subject" value="Test Subject" style="width:185px;border:1px solid #173767;background-color:#FFFFFF;padding-left:2px;padding-right:2px;text-align:left;"><br />
      <b>Message</b>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
      <textarea name="message" style="width:242px;height:150px;border:1px solid #173767;background-color:#FFFFFF;">
    Your Message To Me, Here!
      </textarea>
      <br />
      <div class="cntr">
       <input type="submit" value="Email Me!">
      </div>
     </div>
    </form>
    </div>
    The email works. I could get the page to send the email, but the home request doesnt work.

    Thanks a bunch for any help...
    Last edited by l3vi; 05-03-2004 at 12:28 AM.

  • #2
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    You may want to try this: //www.scriptarchive.com/formmail.html

  • #3
    Regular Coder
    Join Date
    Jan 2003
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thnx but no thnx... I already have the Email Me portion of the script to work. It sends me an email, but the stupid request a home portion of the code doesnt work. It should be the same tho....

    BTW, the page I am using it on is linked to in my siggy...

  • #4
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    What's in send.php?

  • #5
    Regular Coder
    Join Date
    Jan 2003
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts
    send.php is the very first php code I posted...

  • #6
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    try using send.php unless you have reason not to...

  • #7
    Regular Coder
    Join Date
    Jan 2003
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I do use send.php

    I use all three of the files I just posted

  • #8
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    I mean using send.php instead of ./index.php?page=functions.send

  • #9
    Regular Coder
    Join Date
    Jan 2003
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it cant just use send.php the way I do it.. It works, sort of. I have it working for the email me part. That part works. The part that doesnt work is the request a home. THey both use the same script, as u can see, if u look at the send.php source. I just want to know how I can get it to work for both. It should work, but it doesnt...

    Im confuuzeeddddddd :crazy:


  •  

    Posting Permissions

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