...

View Full Version : feedback not sent problem



phpfrnd
09-13-2011, 11:18 AM
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";
}
}
?>

mlseim
09-13-2011, 12:22 PM
What's not working? I don't understand the question.


.

phpfrnd
09-13-2011, 12:47 PM
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

mlseim
09-13-2011, 12:56 PM
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().

.

phpfrnd
09-14-2011, 08:12 AM
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

BluePanther
09-14-2011, 08:23 AM
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?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum