Changing the sender of email
After many unsuccesful tests, I have finally found the solution through
Set the &quot;from&quot; header in the email to be in the format &quot;Full Name&quot; &lt;email@address.com&gt;.

In your module, you must use the following code, which can be customized via the ID of the email or other parameters which are contained in the variable $message (which is passed by reference, so can be modified by the hook):

function my_module_mail_alter(&amp;$message){

    $from = "user-account@domain.name" ;

    $message['from'] = $from;
    $message['headers']['From'] = $from;
    $message['headers']['Sender'] = $from;
    $message['headers']['Return-Path'] = $from;

} // function