Manual:$wgSMTP/Gmail

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

You will need to generate an application password for your instance of Mediawiki in your Google account's security preferences.