I am using mail() function to sent mails when an event happening. But it is not working as I expected. I tried to get the return of the function also. Some one please suggst what may be the issue.
        $msg = "Your password has been changed.is'".$data['password']."'";
        $to = $data['email'];
        $subject = "password changed";
        $headers = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $headers .= 'From: info@hia.com'; 
        $send = mail($to, $subject, $msg, $headers);
        if($send){
            echo "successful";
        }
        else{
            echo "error";
        }
 
    