i'm working on a small project in which i need to send email about incorrect information in a listing. so, i need to send only the incorrect data from form. All works fine but not receiving mail. Is there anything i did wrong.Please help...
if(isset($_POST['report'])){
$name = $_POST['business'];
$address = $_POST['address'];
$phone =$_POST['phone'];
$email = $_POST['email'];
$website = $_POST['website'];
$toemail = "jafar.sain@gmail.com";
$fromwebsite = "www.biz15.co.in";
$error_listing = "business name";
$error_listing_link = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
$subject = "Biz15 - Report an Error in a Listing from ".$fromwebsite;
$body = "You have been requested to go through the following errors from the listing - ".$error_listing."
";
$body .= "Listing Details:
";
$body .= "Listing Name - ".$error_listing."
";
$body .= "Listing Url - ".$error_listing_link."
";
$body .= "Error Details:
";
if($name){$body .= "Business Name - ".$name."
";}
if($address){$body .= "Address - ".$address."
";}
if($phone){$body .= "Phone Number - ".$phone."
";}
if($email){$body .= "Email - ".$email."
";}
if($website){$body .= "Website - ".$website."
";}
$body .= "---------------------------------------------------------------------------
";
$headers = "MIME-Version: 1.0
"."From: ".$toemail."
"."Content-type: text/plain; charset=iso-8859-1
";
if(@mail($toemail,$subject,$body,$headers)){
echo "<script type='text/javascript'>alert('Success');</script>";
}
else{
echo "<script type='text/javascript'>alert('Failed');</script>";
}
}