How to install PHP pear mail on CentOS & RedHat
The PHP mail() function is use inside PHP scripts to send emails. This is the simplest way to send emails but not secure.
Sometimes, the PHP mail() function might be missing and scripts migh start displaying warning/error messages.
In this case, install PHP Mail extension using PEAR. This is simple and east way.
1) Make sure PHP PEAR is present on the server else install it:
[root@localhost ~]#yum install php-pear
2) Install PHP Mail extension using PEAR:
[root@localhost ~]#pear install MailWARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update
Did not download optional dependencies: pear/Net_SMTP, use --alldeps to download automatically
pear/Mail can optionally use package "pear/Net_SMTP" (version >= 1.4.1)
downloading Mail-1.2.0.tgz ...
Starting to download Mail-1.2.0.tgz (23,214 bytes)
........done: 23,214 bytes
3) Restart Apache service and check by loading the script in the problem.
That's all!