Install PHP Pear Mail / SMTP package on CentOS / Red Hat Enterprise Linux

by on October 20, 2007 · 6 comments· Last updated October 20, 2007

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 http://download.pear.php.net/package/Mail-1.1.14.tgz
# wget http://download.pear.php.net/package/Net_SMTP-1.2.10.tgz
# http://download.pear.php.net/package/Net_Socket-1.0.8.tgz

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.



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 6 comments… read them below or add one }

1 anil February 19, 2009 at 5:13 am

Dear
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.

Thanks
anil

Reply

2 Roberto May 26, 2009 at 6:23 pm

Hi

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.

Thanks

Roberto

Reply

3 Unihost Brasil - Servidores de hospedagem November 9, 2010 at 9:03 am

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

Reply

4 Riaz September 12, 2011 at 10:13 am

Hello,

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

Reply

5 Kapil June 20, 2012 at 8:51 am

Thanks

Reply

6 Sikkandar November 22, 2012 at 5:12 am

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

Change

# http://download.pear.php.net/package/Net_Socket-1.0.8.tgz

To

#wget http://download.pear.php.net/package/Net_Socket-1.0.8.tgz

Regards,
Sikkandar.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 5 + 9 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Tagged as: , , , , , , ,

Previous post:

Next post: