Sending smtp email using mail() I have installed and configured https://www.drupal.org/project/smtp module 
sending test email works fine, but when sending email with code nothing is sent and also no log in drupal (I have enabled debugging)

    $ownerEmail = 'email@someemail.com';
    $subject = 'update';
    $msg = 'You case has been updates';
    mail($ownerEmail,$subject,$msg);
mail() is a PHP function, that will never use SMTP.

You need to use the drupal mail manager and its mail function. See https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Mail%21MailManager.php/function/MailManager%3A%3Amail/8.4.x and the example code ther.