Replace token by value in mail I sent an email in a function.

My email body is like "Hello [user:name], blablablala --  Team [site:name]".

But the token aren't replace by their values in the email.

What's wrong ?

Cordially
You need to run token_replace on the email body and pass in the user object for the target user. In your function:
$global $user;

$emluser = user_load($user-&gt;uid);
$body = "Hello [user:name], blablablala -- Team [site:name]";
$body = token_replace($body, array('user' =&gt; $emluser));


You don't need to pass anything for the site tokens to be replaced.