To send an email you need a SMTP server (local or remote). Actually your mail function just passes the mail to your SMTP server and is this one which really send your email.
In your php.ini appears this line
sendmail_path = /usr/sbin/sendmail -t -i
You should be aware if you use that configuration parameter (from manual):
If set, smtp, smtp_port and sendmail_from are ignored and the
specified command is executed.
But the most important thing here is you just uninstall sendmail so you can expect your mail goes nowhere. I know sendmail was giving you some problems, possibly configuration problems, but now your php.ini configuration is wrong.
How to solve it?
Start removing the sendmail_path parameter from the php.ini.
Install a simple to configure SMTP server like postfix.
Verify postfix is listening at port 22:
netstat -lnt
Try to send a mail from your php mail() function
Verify your mail has been sent correctly (check your /var/log/mail.log or /var/log/mail/mail.log files)
You also can verify the mail is not in the postfix queue:
postqueue -f
mail()
function instead of using SMTP. – Layfield