Following a fresh install of Zend Server 2018 (PHP7.2.1) php mail stopped working.
The following message is given in the Apache HTTPD log file www\zendphp7\logs\error_log.Q_date_time_stamp:
sh: /usr/sbin/sendmail: not found
Possible cause when the Zend Server libraries deployed are not updated to the latest versions available.
IBM i not connected to the web,(no internet access).
Download and deploy the latest Zend Framework Libraries.
Use the SMTP Transport found in Zend Framework a more reliable and easy to implement.
In the following article you can find an examples written for Zend Framework 1 and Zend Framework 2.