@Jorge ... your English is just fine! ;)
Is your site running cron often enough?
There is a task which is called by cron job running for many things Moodle.
If you have Linux, you can run the cron job via command line.
In the output look for references to mail related jobs/task.
When you create your own php script, that script will use whatever mail transfer agent is installed on the system - which could be sendmail or postfix (an MTA).
If you access in Moodle, the php info link, you might see/should see what php is using in the 'Core' section ... and rows for sendmail_from and sendmail_path
For testing purposes, one could install Postfix or use sendmail which is probably already on your system if you are not on a shared system. Don't configure it to receive mail ... by default it installs for localhost mail only. Leave it that way.
Could also install a mailer ... Alpine comes to mind.
With Alpine one could address a test message to whatever address isn't getting notifications ... this does NOT use Moodle's PHPMailer but your postfix or sendmail. Advantage in doing this ... if port 25 isn't blocked ... outbound ... the test message will leave your server and attempt delivery of the message. If i fails, you will be able to see the reason why in the mail server logs. In those notices the mail system to which the message was addressed normally provides a URL that you could go check out to find what that mail server found objectionable about the message you sent.
More than likely the other mail server did checks on mail coming from your server and determined it was 'spam'. Mail servers or Mail gateways do a lot of checking for characteristics of the entire message. Most Moodles do NOT have mx records in dns, nor spf, dkim records which are checked by mail servers/gateways getting mail from your Moodle.
More often that not, the setup of an SMTP relay solves the issues. SMTP serves do have all those DNS records, etc.
'spirit of sharing', Ken