Hello Alexis,
Good to know that enabling the Less Secure Application helped you to solve this problem.
We have also used GSuite account with this class to send email from PHP and we used it in conjunction with the MIME Message composing and sending class to make it easier to compose HTML and text messages, maybe with attachments and other email features.
You can find the MIME Message package here:
phpclasses.org/package/9-PHP-PHP-ma
...