This page provides an example for setting the $wgSMTP configuration parameter if you would like to use Gmail for sending emails by your wiki.

$wgSMTP = [
    'host' => 'ssl://',  // hostname of the email server
    'IDHost' => '',
    'port' => 465,
    'username' => '', // user of the email account
    'password' => '****************',  // app password of the email account
    'auth' => true

You will need to generate an application password for your instance of Mediawiki in your Google account's security preferences. Google discourages app passwords as insecure, but it's the only choice for non-interactive authentication with Google. So, you first have to enable two-factor authentication on your GMail account. Then you can create an app password in your Google account, and use that in the password setting shown above.