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 8 of 8

Thread: mail error

  1. #1
    New Coder
    Join Date
    Aug 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mail error

    hi all,
    below send mail programe said line 3 error, could you pls find why is that and let me know pls
    [line 3 mean $message ="Name:....... this line]
    thanx

    <?php
    "----------------------------------------------------------------------"
    $message="Name: ".$_POST['main_name']."\n". "Email: ".$_POST['email']. "\n"."Comments: ".$_POST['comme']."\n";
    $headers="From: TOSOJK<tosojk@gmail.com>\r\n";
    $date = date("l, F d, Y h : i", time());
    $to="tosojk@gmail.com";
    $subject="Comments from Visitor - Contact us";
    mail($to, $subject, $message, $headers);
    header("Location:confirmation.html");
    ?>

  • #2
    Regular Coder Rappa's Avatar
    Join Date
    Nov 2005
    Location
    LI
    Posts
    356
    Thanks
    21
    Thanked 9 Times in 9 Posts
    can we have the full code? and the whole error?

  • #3
    New Coder
    Join Date
    Aug 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Rappa View Post
    can we have the full code? and the whole error?
    this is the full code my dear,

  • #4
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    This line is not valid php, remove it.
    Code:
    "----------------------------------------------------------------------"
    And, the error message should have given you more information. To help people help you, it's a good idea to post the whole text of the error message.

    Edit:
    Also, your form does no error checking and is not secure.
    Last edited by PappaJohn; 08-10-2007 at 06:41 AM. Reason: more info

  • #5
    New Coder
    Join Date
    Aug 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by PappaJohn View Post
    This line is not valid php, remove it.
    Code:
    "----------------------------------------------------------------------"
    And, the error message should have given you more information. To help people help you, it's a good idea to post the whole text of the error message.

    Edit:
    Also, your form does no error checking and is not secure.
    okey, i found another one good code but the thing is it say this mail has been send but i cant recieved from my gmail, could you pls tell me why is that

    <?php
    $name = $_POST['name'];
    $email = $_POST['email'];
    $message = $_POST['message'];
    $formcontent="VISITOR NAME: $name\n\nFEEDBACK: $message";
    $recipient = "somiadiscon@gmail.com";
    $subject = "Contact Form";
    $mailheader = "From: $email\r\n";
    $mailheader .= "Reply-To: $email\r\n";
    $mailheader .= "MIME-Version: 1.0\r\n";
    mail($recipient, $subject, $formcontent, $mailheader) or die("Failure!");
    echo "Thank You!";
    ?>

  • #6
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    The first line of invalid code will throw a parse error for line 3 and if display_errors = 0, you'll see nothing but a blank page.
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.

  • #7
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    gmail, yahoo, hotmail and all the other free email providers - very unreliable. Test to a real email address first, not to a throw away mail address provider.

    And every spambot in town is going to love your script.
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.

  • #8
    New Coder
    Join Date
    Aug 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by meth View Post
    gmail, yahoo, hotmail and all the other free email providers - very unreliable. Test to a real email address first, not to a throw away mail address provider.

    And every spambot in town is going to love your script.
    thanx for your opinion, here do u know any feedback programm will support to gmail


  •  

    Posting Permissions

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