Results 1 to 8 of 8

Thread: mail function in php

  1. #1
    Join Date
    Mar 2007
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default mail function in php

    i have a form with all sorts of details which whn submitted the details are entered into the database and a mail should be sent to the owner's email id with all the details..
    the mail functon is not working..i had entered a demo mail function in my code but thts not working also.
    this is really imp can someone pls help.

    thanks in advance..
    suk'

    the code i had written is:he code marked in red does not work..

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>

    <body>
    <?php
    echo "hhhvhvh";
    include 'db.php';
    $valid=false;
    $sql="INSERT INTO `tbl_contact` (
    `first_name` ,
    `middle_name` ,
    `last_name` ,
    `street1` ,
    `street2` ,
    `city` ,
    `pincode` ,
    `state` ,
    `country` ,
    `country_code` ,
    `area_code` ,
    `contact_num` ,
    `email` ,
    `organization` ,
    `topic` ,
    `comment` ,
    `date`
    )
    VALUES (
    '".$_POST['fname']."','".$_POST['mname']."','".$_POST['lname']."','".$_POST['street1']."','".$_POST['street2']."','".$_POST['city']."','".$_POST['pin']."','".$_POST['state']."','".$_POST['country']."','".$_POST['ccode']."','".$_POST['acode']."','".$_POST['contact']."','".$_POST['email']."','".$_POST['org']."','".$_POST['topic']."','".$_POST['comment']."','".$_POST['date']."')";
    echo $sql;
    //exit;
    if(mysql_query($sql,$con))
    $valid=true;

    if ($valid)
    {

    $txt = "First line of text\nSecond line of text";// Use wordwrap() if lines are longer than 70 characters
    $txt = wordwrap($txt,70);// Send email
    mail("sukanya.p@brickworkindia.com","My subject",$txt);


    echo("<script>location.href ='thankyou.php'</script>");
    }
    else
    echo("<script>location.href ='contact_us.php'</script>");

    ?>
    </body>
    </html>

  2. #2
    Join Date
    Mar 2007
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    110 ppl read this post but could not reply??surprising!!!!

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Seems to be correct.

    Is PHP installed/working on that server?

    Is there any error?

    Are you on a windows server? With Godaddy by chance?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Mar 2007
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well i got it solved but used some other code.. ya doin it with GoDaddy..
    thanks anyways

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Godaddy's windows servers have a few very screwed up elements with PHP, and the mail tag is basically disabled. So, there's your answer.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Mar 2007
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok..wekk no problem.. i used something else and got it resolved..
    thanks for the reply though...

  7. #7
    Join Date
    Oct 2006
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down

    Quote Originally Posted by djr33 View Post
    Godaddy's windows servers have a few very screwed up elements with PHP, and the mail tag is basically disabled. So, there's your answer.
    Dammit. Well, strike that from my website...

  8. #8
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by Shotgun Ninja View Post
    Dammit. Well, strike that from my website...
    thats why its important to compare hosting plans against something other then just price..

Bookmarks

Posting Permissions

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