Recently I’ve noticed that Redhat removed support for following php pear packages:

a) NET/SMTP : An implementation of the SMTP protocol

b) Mail : Class that provides multiple interfaces for sending emails

c) Net/Socke : Network Socket Interface

The simplest solution is downloading and installs these files from php pear repo.

Step # 1: Download files

Use wget command to download all files:
# cd /tmp
# wget
# wget

Untar all files:
# tar -zxvf Mail-1.1.14.tgz
# tar -zxvf Net_SMTP-1.2.10.tgz
# tar -zxvf Net_Socket-1.0.8.tgz

Step # 2: Install files

Simply copy file to your webroot such as /www/usr/share/pear or standard location such as /usr/share/pear:
# cd /usr/share/pear
# mkdir Net
# cd Net
# cp /tmp/Net_SMTP-1.2.10/SMTP.php .
# cp /tmp/Net_Socket-1.0.8/Socket.php .
# cd ..
# cp -avr /tmp/Mail-1.1.14/Mail/ .
# cp -avr /tmp/Mail-1.1.14/Mail.php .

Step # 3: Test SMTP email

Now you have required files, all you have to do is send email using authenticated smtp server.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 8 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
8 comments… add one
  • anil Feb 19, 2009 @ 5:13

    One querry ! How to find the pear path on a rhel4 server. I got 10 servers already installed with pear. but every system have a diff pear path as mentioned in document. So how can i find the pear path if i don’t have the documentation with me.


  • Roberto May 26, 2009 @ 18:23


    I installed RedHat 5.3 and I found the same problem with others packages. To solve it I installed php-pear and from command line I installed additional packages, for example:

    # pear install Mail
    # pear install DB

    I did it with other packages and worked very well.



  • Unihost Brasil - Servidores de hospedagem Nov 9, 2010 @ 9:03

    To install PEAR MAIL package you can use:

    /usr/local/bin/pear install Mail
    /usr/local/bin/pear install Net_SMTP
    /usr/local/bin/pear install Net_Socket

    Alex M. – Tech. Support
    Unihost Brasil

  • juan miguel garcia retamar Mar 30, 2011 @ 15:45

    Es mas sencillo ejecutar

    yum install php-pear-Mail

  • Riaz Sep 12, 2011 @ 10:13


    How can one setup smtp? I tried all that but it is not helping me.

  • Kapil Jun 20, 2012 @ 8:51


  • Sikkandar Nov 22, 2012 @ 5:12

    This guide helps a lot. Thanks for that. Please correct the type at step 1.






  • thea7y Mar 12, 2014 @ 4:24

    why would you need to untar and copy files?
    all you need to do after download the package is just : pear install downloaded_page_name.tgz
    specifically, when you install Net_SMTP, add this at the end: –alldeps
    it will install Net_Socket for you as well.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum