Overview
Many websites use PHP to send email via SMTP. For example, you could create a custom mail form, or use a WordPress SMTP plugin.
A problem you will run into is that Google's security settings do not allow you to send via SMTP through their servers unless you explicitly allow this.
Enable the OAuth 2.0 protocol to authenticate connections
The solution is to enable OAuth 2.0 authentication for your application.
- https://developers.google.com/gmail/api/auth/about-auth
- Enabling the OAuth 2 API to use with your WordPress Mail SMTP plugin
Please note that support is unable to assist with this custom configuration.