Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    232

    PHP form mail send automatically

    hi, i have a form which send automatically, how can i fix it ,please, here is my code

    Code:
    <?
    $name=$_POST['name'];
    $phone=$_POST['phone'];
    $email=$_POST['email'];
    $comments=$_POST['comments'];
    $to="ozchinese@hotmail.com";
    $message="$name just filled in your comments form. Phone number is: $phone, They said:\n$comments\n\nTheir e-mail address was: $email";
    
    if(mail($to,"Comments From Your http://www.aimrealty.com.au",$message,"From: $email\n")) {
    echo "Thanks for your comments.";
    } else {
    echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
    }
    ?>
    the page is in
    http://www.aimrealty.com.au/contact.php

  2. #2
    Join Date
    Mar 2007
    Location
    UK
    Posts
    89
    Hello,

    I just tried it, and got a "Thanks for your comments" message.

    In what way is it broken? You don't get the email? Please provide some more details.

    Or is it working now?


    Incidentally, I would put the "Thankyou for your comments" message at the top of the response page, and in a more prominent font size.
    When I submitted the form I assumed that something had gone wrong because the thank you message was below the fold.
    Do you need to reshow the contact form again following a successful send?
    Just my 2c.

Posting Permissions

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