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 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Email form says it sends, but doesn't

    I believe this is the right forum to post my thread, but if not, sorry in advance.

    I'm having problems with the email ordering form that I have set up on my website. Whenever I click submit, it says that it has sent the information, but I never receive any emails.

    Here's the PHP:
    PHP Code:
    <?php 
    if ($_POST['Submit']) 

            
    // email data here 
            // $var_name = $_POST['form_object_name']; 
             
            
    $your_email "CKMeth007@hotmail.com"
            
    $subject     "Massive Speed System Order"
             
            
    $name         $_POST['name'];  
            
    $email         $_POST['email'];  
            
    $website    $_POST['website']; 
            
    $comments    $_POST['comments']; 
            
    $fav_thing    $_POST['fav_thing']; 
            
    $country    $_POST['country']; 
             
            
    $body "<strong>First Name</strong> " $name "<br>" 
                    
    "<strong>Last Name</strong> " $name_last "<br>" 
                    
    "<strong>Street</strong> " $street .  "<br>" 
                    
    "<strong>City </strong>" $city .  "<br>" 
                    
    "<strong>State </strong>" $state .  "<br>" .
                    
    "<strong>Zip Code</strong> " $zip_code "<br>" 
                    
    "<strong>Product</strong> " $product "<br>" .
                    
    "<strong>Quantity</strong> " $quantity "<br>" .
                    
    "<strong>Color</strong> " $color "<br>" .
                    
    "<strong>Card Name</strong> " $card_name "<br>" .
                    
    "<strong>Card No</strong> " $card_no "<br>" .
                    
    "<strong>Expiration Date</strong> " $expiration_date "<br>" .
                    
    "<br>" .  
                    
    "<strong>Comments</strong> <br>" $comments
                    
                
    mail($your_email$subject$body"From: \"$name\" <$email>\nContent-Type: text/html; charset=iso-8859-1"); 
                echo 
    "Thank you, your data has been submitted. We will contact you as soon as possible."

    ?>
    And the HTML:
    Code:
    <form action="http://www.massivespeedsystem.com/orderform2.php" method="post" target="_blank">
    
    <fieldset class="fieldset">
    
    <legend><font color="f77e11">NAME</font></legend>
    <label for="first name">First</label><br class="nobr" />
    <input name="first name" type="text" class="textfield"  id="first name"  />
    <br />
    
    <label for="last name">Last</label><br class="nobr" />
    <input name="last name" type="text" class="textfield" id="last name" />
    <br />
    <br />
    
    <legend><font color="f77e11">ADDRESS</font></legend>
    <label for="street">Street</label><br class="nobr" />
    <input name="street" type="text" class="textfield"  id="street"  />
    <br />
    
    <label for="city">City</label><br class="nobr" />
    <input name="city" type="text" class="textfield" id="city" />
    <br/>
    
    <label for="state">State</label><br class="nobr" />
    <input name="state" type="text" class="textfield" id="state" />
    <br/>
    
    <label for="zip code">Zip Code</label><br class="nobr" />
    <input name="zip code" type="text" class="textfield" id="zip code" />
    <br />
    <br />
    
    <legend><font color="f77e11">PRODUCT INFORMATION</font></legend>
    <label for="product">Product</label><br class="nobr" />
    <input name="product" type="text" class="textfield"  id="product"  />
    <br />
    
    <label for="quantity">Quantity</label><br class="nobr" />
    <input name="quantity" type="text" class="textfield" id="quantity" />
    <br/>
    
    <label for="color">Color</label><br class="nobr" />
    <input name="color" type="text" class="textfield" id="color" />
    <br/>
    <br />
    
    <legend><font color="f77e11">PAYMENT INFORMATION</font></legend>
    <label for="card">Card Name</label><br class="nobr" />
    <input name="card" type="text" class="textfield"  id="card"  />
    <br />
    <br />
    
    <label for="number">Card No.</label><br class="nobr" />
    <input name="number" type="text" class="textfield" id="number" />
    <br/>
    
    <label for="expiration">Expiration Date</label><br class="nobr" />
    <input name="expiration" type="text" class="textfield" id="expiration" />
    <br />
    <br />
    
    <label for="comment">Comments?</label><br class="nobr" />
    <textarea cols="30" rows="15" name="comment" id="comment" class="textarea"></textarea>
    <br />
    
    <label for="Submit">&nbsp;</label><br class="nobr" />
    <input name="Submit" type="submit" class="submit" id="submit" value="Submit" />
    </fieldset>
    
    </form>
    Does anyone know why it says that the order has been placed/that the email has been sent but I never receive any orders or emails?

    Please note, that as soon as this problem is fixed, this order form will be set up with secure ordering.

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    You don't check that mail() has mailed (nor can you, I don't think). The output is written regardless.
    You host has to have sendmail configured properly.
    http://us2.php.net/manual/en/ref.mail.php

    Check that you can do a very basic mail at all with the mail command before assuming it is anything at all wrong in your script. Maybe their mail server is down or something.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    New Coder
    Join Date
    Apr 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I sort of understand what you're saying, but for the most part I'm confused. Sorry, I'm still very new at this stuff.

    Anyways, right now, I have the form set up so that it sends any emails to MY email address (it will be changed to my boss' as soon as the website is done). This way, I can check to see if the form actually sends anything. No matter what I do, I never receive any emails.

  • #4
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    You need to check with your host to make sure this mail command is configured.
    Who owns the web server this is running from?
    Can you get a command line?

    The PHP mail command requires sendmail. See the link I posted.
    The mail could be sitting in a queue somewhere and not getting sent. Or it could be going to /dev/null.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/


  •  

    Posting Permissions

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