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 6 of 6
  1. #1
    New Coder
    Join Date
    Jan 2011
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    feedback not sent problem

    hello sir

    please help me

    i have a feedback form in my website,where user fill up the form and submit,i want feedback on my email id from mywebsite.but feedback not sent on my email id,direct excute else condtion

    this is my html form and code


    ------------------------------
    <!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>
    <table width="400" border="0" align="center" cellpadding="3" cellspacing="1">
    <tr>
    <td><strong>feed</strong></td>
    </tr>
    </table>

    <table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
    <tr>
    <td><form name="form1" method="post" action="">
    <table width="100%" border="0" cellspacing="1" cellpadding="3">
    <tr>
    <td width="16%">Subject</td>
    <td width="2%">:</td>
    <td width="82%"><input name="subject" type="text" id="subject" size="50"></td>
    </tr>
    <tr>
    <td>Detail</td>
    <td>:</td>
    <td><textarea name="message" cols="50" rows="4" id="message"></textarea></td>
    </tr>
    <tr>
    <td>Name</td>
    <td>:</td>
    <td><input name="name" type="text" id="name" size="50"></td>
    </tr>
    <tr>
    <td>Email</td>
    <td>:</td>
    <td><input name="user_mail" type="text" id="user_mail" size="50"></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><input type="submit" name="Submit" value="Submit">
    <input type="reset" name="Submit2" value="Reset"></td>
    </tr>
    </table>
    </form>
    </td>
    </tr>
    </table>

    </body>
    </html>




    <?php
    if(isset($_POST['Submit']))
    {
    $to ="1234@gmail.com";
    $subject =$_POST['subject'];
    $message =$_POST['message'];
    $user_mail=$_POST['user_mail'];
    $headers = "From: $user_mail";


    $sent=mail($to,$subject,$message,$headers);

    if($sent)
    {
    echo "Thanks";
    }
    else
    {
    echo "Not Sent";
    }
    }
    ?>

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,531
    Thanks
    8
    Thanked 1,091 Times in 1,082 Posts
    What's not working? I don't understand the question.


    .

  • #3
    New Coder
    Join Date
    Jan 2011
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    feedback from

    sir i want to submit a feedback from mywebsite and i want it goes to my email id.this code not working ,execute only else part that is-not se email.
    sir please check my code..where is problem

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,531
    Thanks
    8
    Thanked 1,091 Times in 1,082 Posts
    Try changing this part:

    $sent=mail($to,$subject,$message,$headers);

    if($sent)
    {
    echo "Thanks";
    }
    else
    {
    echo "Not Sent";
    }


    To this:

    if(!mail($to,$subject,$message,$headers)){
    echo "Not Sent";
    }
    else{
    echo "Thanks";
    }



    If you still can't get it to work ...
    the other problem might be that your webhost doesn't allow mail().

    .

  • #5
    New Coder
    Join Date
    Jan 2011
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hello sir

    same problem,email not sent.
    please help me,
    how to submit feedback from mywebsite feedback,and feedback should be sent on my gmail or yahoomai,id

  • #6
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Using mlseim's function, are you getting a message saying 'not sent'? Or are you receiving the message sent message, just not getting the email?


  •  

    Posting Permissions

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