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>



Reply With Quote



Bookmarks