Web Analytics Made Easy -
StatCounter feedback not sent problem - CodingForum

Announcement

Collapse
No announcement yet.

feedback not sent problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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 ="[email protected]";
    $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
    What's not working? I don't understand the question.


    .

    Comment


    • #3
      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

      Comment


      • #4
        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().

        .

        Comment


        • #5
          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

          Comment


          • #6
            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?
            Useful function to retrieve difference in times
            The best PHP resource
            A good PHP FAQ
            PLEASE remember to wrap your code in [PHP] tags.
            PHP Code:
            // Replace this
            if(isset($_POST['submitButton']))
            // With this
            if(!empty($_POST))
            // Then check for values/forms. Some IE versions don't send the submit button 
            Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

            Comment

            Working...
            X
            😀
            🥰
            🤢
            😎
            😡
            👍
            👎