Then you can take a dive into the sendmail logs on the machine. This isn't directly a PHP issue, so you'll need to find out what's wrong with the sendmail.
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php