hook_mail dosen't work? I have these two functions,
the first is to send the email via drupal_mail() function :

function example_function_name($what) {
  drupal_mail('MYMODULE', 'some_mail_key', 'myaddress@gmail.com', language_default());
}


And the second is the hook_mail function :

function MYMODULE_mail($key, $message, $params){
    switch ($key){
        case 'some_mail_key': 
            $message['subject'] = 'test subject';
            $message['body'] = 'test body message';
            break;
    }
}


But I recieve a blank email in spam without neither subject, or body message.
Is there somthing missing here ?

Thanks in advance.
hook_mail is supposed to take message by reference. The way you do it, you are modifying a local copy, and your modifications cannot ever leave the function's body. It should look like this:

function MYMODULE_mail($key, &amp;$message, $params){
    switch ($key){
        case 'some_mail_key': 
            $message['subject'] = 'test subject';
            $message['body'] = 'test body message';
            break;
    }
}


This little ampersand is what makes all the difference. You cannot omit them. If API defined hook with reference argument, keep it a reference argument, or expect problems.