This is my code and it's return true but i didn't receive any mail. It's working on another website. I want to check my code is working or not.
$name = $this->input->post('name');
$email = $this->input->post('email');
$phone = $this->input->post('phone');
$message = $this->input->post('msg');
// Email content
$body = "Hi xxx<br /><br />";
$body.= "Name : " . $name . "<br />";
$body.= "Email : " . $email . "<br />";
$body.= "Phone No : " . $phone . "<br />";
$body.= "Message Placed: " . $message . "<br />";
$body.= "<br />For Enquiry Request</br> ";
$subject = "Consultation email";
$to ="xxxxx@xxxxx.in";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <'.$email.'>' . "\r\n";
if(mail($to,$subject,$body,$headers))
{
echo '<script>alert("Your message has been sent, our associate will get back to you soon")</script>';
echo '<script>window.location.href="' . base_url() . '"</script>';
}
else{
echo '<script>alert("your message has been not sent")</script>';
echo "<script>window.location.href='" . base_url() . "'</script>";
}