Sending form to mail from custom module fails without error
Did you implement hook_mail in your module? – Alfred Armstrong
where to place the hook_mail function? – Lance

Goes in the .module file. Ex: my_module.module
/*
* Implements hook_mail().
*/
function my_module_mail($key, &amp;$message, $params) {
  switch($key) {     
    case 'my_module':
      $options = [
        'langcode' =&gt; $message['langcode'],
      ];
      $message['subject'] = t('@title', ['@title' =&gt; $params['context']['subject']], $options);
      $message['body'][] = t('@body', ['@body' =&gt; $params['context']['message']], $options);         
      break; 
  }
}

Flush all caches so hook gets picked up.