phpmailer with oauth2
for php 7
'./configure' '--with-openssl' '--enable-fpm' '--with-pgsql' '--with-pdo-pgsql'
http://localhost/mail/get_oauth_token.php
get refresh token from script and id and secret from https://console.developers.google.com/ and save exmple ini as mail.ini with values
Note that id and secret can be retrieved from google but refresh token has to be saved locally.