+ Reply to Thread
Results 1 to 9 of 9

Thread: need help with mail()

  1. #1
    lmteestalk is offline x10Hosting Member lmteestalk is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    5

    need help with mail()

    i can't receive the email that i wanted to have... my code are as follows:

    my order.php

    Code:
    <form id="orderform" method="POST" action="go.php">
    <br /><hr>
    <b><font size=4>Item Information</font></b><br>
    <hr />
    <br>
    Item Name :<br />
    <input name="ItemName" type="text" id="ItemName" maxlength="25" /><br /><br />
    
    Quantity : (Minimum of 2 pcs to 100 pcs only)<br />
    <input name="Quantity" id="Quantity" type="text" maxlength="3" /><br /><br />
    
    Color :<br>
    <select name="Color" id="Color">
      <option>Green</option>
      <option>Blue</option>
      <option>Yellow</option>
      <option>Red</option>
      <option>Navy Blue</option>
      <option>Light Blue</option>
      <option>Black</option>
      <option>Orange</option>
    </select>
    <br /><br />
    <hr />
    <b><font size=4>Customer Information</font></b><br>
    <hr />
    <br />
    Customer Name : <br />
    <input name="CustomerName" id="CustomerName" type="text" maxlength="100" class="nml"/><br /><br />
    
    Customer Address : (Please include your zip code)<br />
    <textarea name="CustomerAddress" id="CustomerAddress" class="nml" ></textarea>
    <br /><br />
    
    Customer Contact Number(s): <br />
    <input name="CustomerContactNumber" id="CustomerContactNumber" type="text" maxlength="100" class="nml"/><br /><br />
    
    E-Mail Address : <br /><input name="Email" id="Email" type="text" maxlength="100" class="nml"/><br /><br />
    
    Optional Message : <br />
    <input name="OptionalMessage" id="OptionalMessage" type="text" maxlength="1000" class="hyt" /><br /><br />
    
    By clicking "Submit Order". I verify that all statements are correct and free from any error and thus completing my order request.
    
    <input name="" id="submit" type="submit" value="Submit Order" /><br /><br />
    Click "Clear Fields" to reset the form.<br />
    <input name="" type="reset" value="Clear Fields" />
    
    
    </form>

    and my go.php is:
    Code:
    <?php
    
    if(isset($_POST['submit'])) {
    $to = "lynmick_aus@yahoo.com";
    $subject = "Order received";
    $headers="Message-ID: <".mktime()."@".$_SERVER['SERVER_NAME'].">\r\n";
    $headers.="X-Mailer: PHP v".phpversion()."\r\n";
    $headers.="Content-Type: text/html; charset=iso-8859-1\r\n"; //your char set here
    
    
    $body = "Order Information:\s
    Item Name: ".$_POST['ItemName']."\s
    Quantity: ".$_POST['Quantity']."\s
    Color: ".$_POST['Color']."\s
    Name: ".$_POST['CustomerName']."\s
    Address: ".$_POST['CustomerAddress']."\s
    Number: ".$_POST['CustomerContactNumber']."\s
    Email: ".$_POST['Email']."\s
    Optional Message: ".$_POST['OptionalMessage']."\s";
    
    mail($to, $subject, $body, $headers);
    }
    ?>

    what seems to be my problem?

    i uploaded this to my www and public_html
    what else do i lack?

    thanks..
    Last edited by lmteestalk; 07-24-2009 at 02:45 AM.

  2. #2
    whizynix02's Avatar
    whizynix02 is offline x10Hosting Member whizynix02 is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    95

    Re: need help with mail()

    did you look at your spam folder... ? yahoo sometimes treat email from email forms as spam... hmmm that's my problem on my form... it seems like i'm not receiving it but it's all in my spam folder...

    hope this help you...
    think big, think Smart

  3. #3
    lmteestalk is offline x10Hosting Member lmteestalk is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    5

    Re: need help with mail()

    there are no messages in my spam folder

  4. #4
    whizynix02's Avatar
    whizynix02 is offline x10Hosting Member whizynix02 is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    95

    Re: need help with mail()

    :werd: hmmm maybe its on the code itself... maybe there is an unnoticed spot there.. it's seems correct but what went wrong...
    think big, think Smart

  5. #5
    lmteestalk is offline x10Hosting Member lmteestalk is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    5

    Re: need help with mail()

    i read somewhere that it has something to do with smtp? or php.ini or stuffs like that.. there are only 5 phppages that i uploaded. and 1 php to be called after clicking submit.. im so desperate i've been dealing with this problem for 4 days now.. i really have to get this working..

  6. #6
    whizynix02's Avatar
    whizynix02 is offline x10Hosting Member whizynix02 is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    95

    Re: need help with mail()

    i don't know if this going to work, i've change "hhhh" to 'hhhh '


    $body = 'Order Information:\s
    Item Name: '.$_POST['ItemName'].'\s
    Quantity: '.$_POST['Quantity'].'\s
    Color: '.$_POST['Color'].'\s
    Name: '.$_POST['CustomerName'].'\s
    Address: '.$_POST['CustomerAddress'].'\s
    Number: '.$_POST['CustomerContactNumber'].'\s
    Email: '.$_POST['Email'].'\s
    Optional Message: '.$_POST['OptionalMessage'].'\s';
    think big, think Smart

  7. #7
    lmteestalk is offline x10Hosting Member lmteestalk is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    5

    Re: need help with mail()

    Quote Originally Posted by whizynix02 View Post
    i don't know if this going to work, i've change "hhhh" to 'hhhh '

    it doesn't work...:tear:

  8. #8
    whizynix02's Avatar
    whizynix02 is offline x10Hosting Member whizynix02 is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    95

    Re: need help with mail()

    hmmm taugh one... hmmm maybe i debug it when i got home..
    think big, think Smart

  9. #9
    zapzack is offline x10 Elder zapzack is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    606

    Re: need help with mail()

    try

    Code:
    <?php
    
    if($_POST['submit']) {
    $to = "lynmick_aus@yahoo.com";
    $subject = "Order received";
    $headers="Message-ID: <".mktime()."@".$_SERVER['SERVER_NAME'].">\r\n";
    $headers.="X-Mailer: PHP v".phpversion()."\r\n";
    $headers.="Content-Type: text/html; charset=iso-8859-1\r\n"; //your char set here
    
    
    $body = "Order Information:\s
    Item Name: ".$_POST['ItemName']."\s
    Quantity: ".$_POST['Quantity']."\s
    Color: ".$_POST['Color']."\s
    Name: ".$_POST['CustomerName']."\s
    Address: ".$_POST['CustomerAddress']."\s
    Number: ".$_POST['CustomerContactNumber']."\s
    Email: ".$_POST['Email']."\s
    Optional Message: ".$_POST['OptionalMessage']."\s";
    
    mail($to, $subject, $body, $headers);
    }
    ?>

+ Reply to Thread

Similar Threads

  1. Gmail Vs. Others
    By porky101 in forum Crossfire
    Replies: 44
    Last Post: 11-05-2011, 08:14 AM
  2. Replies: 9
    Last Post: 08-11-2011, 05:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers