I found the solution
at the folder /var/www/html/moodle/auth/emailadmin
there is:
foreach($admins as $admin) {
if (!in_array($admin->username, $errors)) {
$result = email_to_user($admin, $supportuser, $subject, $message, $messagehtml);
break;
}
}
Because i want to send it to at an email that there isn't any user i change the code to this:
$to= new stdClass();
$to->firstname="";
$to->lastname="";
$to->email="xxxxxx@gmail.com";
$to->maildisplay=true;
$to->mailformat=1;// 0 simle text, 1 with html elements
$to->id=-99;//there isn't user of moodle site
$to->firstnamephonetic="";
$to->lastnamephonetic="";
$to->middlename="";
$to->alternatename="";
$result = email_to_user($to, $supportuser, $subject, $message, $messagehtml);
And it works fine