How to install PHP pear mail on CentOS & RedHat

Share with all..

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 "" has updated its protocols, use "pear channel-update" 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 with all..

About Abhijit Sandhan

Loves Open Source, Blogging, Traveling, Hiking and sharing Knowledge!

Leave a Reply

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