How to send Email using PHP mail method


if(isset($_POST['contactBtn'])){
    $firstName = $_POST['first_name'];
    $lastName = $_POST['last_name'];
    $mobile = $_POST['mobile'];
    $email = $_POST['email'];
    $subject = $_POST['subject'];
    $msg = $_POST['message'];//echo $msg;exit;

    $message    =   'Name:  '.$firstName.' '.$lastName;
    $message    .=  'Mobile '.$mobile;
    $message    .=  'Email '.$email;
    $message    .=  'Subject '.$subject;
    $message    .=  'Message '.$msg;

    $to = $email ;
    $subject = "jswebsolutions WEBSITE ENQUIRY";
    $from = "demo@jswebsolutions.in";
    
    $headers = "From: " . $from . "\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    // PREPARE THE BODY OF THE MESSAGE
    $mailCheck = mail($to, $subject, $message, $headers);
    if ($mailCheck==TRUE)
    {
       // echo "mail send successfully";
    }
    else
    {
        // echo "Something went wrong, please try again.";
    }
}