If your server installed cPanel with CloudLinux along alt-php and you want to disable php mail() function for one domain, then you can do this using the following steps :
2. Add below lines at the top of this file:
Default = /usr/sbin/sendmail -t -i
Type = list
Range = /usr/sbin/sendmail -t -i,/bin/true
Comment = Switch to /bin/true to disable php mail
3. Then, logged into client’s cpanel, change the sendmail path to /bin/true using “Select PHP Version > Switch to PHP Settings”.
Enjoy and let me know your thoughts on this article.