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:

[[email protected] ~]#yum install php-pear

2) Install PHP Mail extension using PEAR:

[[email protected] ~]#pear install Mail

WARNING: 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!

Share on Facebook2
Share on Google+6Tweet about this on TwitterShare on StumbleUpon0Share on LinkedIn0Share on Tumblr0Digg thisPin on Pinterest0Share on Reddit0Email this to someonePrint this page

About Abhijit Sandhan

Abhijit Sandhan
Loves Linux, Blogging, Traveling, Hiking and sharing knowledge!

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA