How to switch mail() functionality in OJS 3.1.1-4 on (or off)?

The intent within OJS is for all of the mail configurations to live in config.inc.php. If you enter SMTP configuration here (such as directly to Gmail), OJS will connect directly there. If you turn off SMTP here, then OJS will rely on your server’s native mail handling, via PHP’s mail() function. Many email providers are increasingly depending on compliance with SPF, DKIM, and DMARC standards which require that OJS’s sender be trusted by the recipient. Both Gmail and Yahoo have been early adopters of these standards.

You can find more discussion on this here:

The most recent changes on this are scheduled against 3.1.2: