i am not able to send email in php,Any one help me to identify i am not able to send email in php,Any one help me to identify where i am wrong.After filling form All details has to go a specified email.but here it is displaying else condition.So,Please help me to solve this problem. i am not able to send email in php,Any one help me to identify where i am wrong.After filling form All details has to go a specified email.but here it is displaying else condition.So,Please help me to solve this problem. i am not able to send email in php,Any one help me to identify where i am wrong.After filling form All details has to go a specified email.but here it is displaying else condition.So,Please help me to solve this problem. where i am wrong.After filling form All details has to go a specified email.but here it is displaying else condition.So,Please help me to solve this problem.
<?php
$englishname = $_REQUEST['firstname'].' '.$_REQUEST['lastname'];
$arabicname = $_REQUEST['firstnamearabic'].' '.$_REQUEST['lastnamearabic'];
$education = $_POST['education'];
$ar_education = $_POST['educationarabic'];
$email = $_POST['email'];
$country= $_POST['parent_cat'];
$city= $_POST['cit_cat'];
$area= $_POST['area'];
$mobilenumber= $_POST['mobileno'];
$doorno= $_POST['doorno'];
$phone= $_POST['phoneno'];
$street= $_POST['street'];
$apartment = $_POST['apartment'];
$experience = $_POST['experience'];
$postalcode = $_POST['postelcode'];
$landmark = $_POST['landmark'];
if(isset($_POST['requesttype'])&&$_POST['requesttype'] == 'addEmployee')
{
$to = 'arundsti@gmail.com';
$subject = 'NEW DOCTOR REGISTRATION DETAILS-FIND A DOCTOR';
$from = $_REQUEST['email'];
// mandatory headers for email message, change if you need something different in your setting.
$headers = "From: " . $from . "
";
$headers .= "Reply-To: ". $from . "
";
$headers .= "CC: info@findadoctorsa.com
";
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-Type: text/html; charset=ISO-8859-1
";
$message = "Name in English: $englishname.
";
$message .= "Name in Arabic: $arabicname.
";
$message .= "Education: $education
";
$message .= "Education in Arabic: $ar_education
";
$message .= "Email: $email
";
$message .= "Country: $country
";
$message .= "City: $city
";
$message .= "Area: $area
";
$message .= "Mobilenumber: $mobilenumber
";
$message .= "DoorNumber: $doorno
";
$message .= "PhoneNumber: $phone
";
$message .= "Street: $street
";
$message .= "Apartment: $apartment
";
$message .= "Experience: $experience
";
$message .= "Postalcode: $postalcode
";
$message .= "Landmark: $landmark
";
$sent = mail($to, $subject, $message, $headers);
if($sent){ ?>
<script>
alert('Your Details received Successfully...We will Touch with you shortly');
</script>
<?php
}
else {?>
<script>
alert('Sorry Problem in Submitting Details,Please try Again');
</script>
<?php
}
}
?>