I was trying to setup a php script to send mail with SMTP Authentication. The script was ready, but when executed in a browser, it displayed the following error.
Fatal error: Class ‘Net_SMTP’ not found in /usr/local/lib/php/Mail/smtp.php on line 349″
The problem appears because the php pear package Net_SMTP is not present in the server. You can install it in two way.
- Install the Mail package with –alldeps which will install all required dependencies like Net_SMTP
pear install –alldeps Mail
If Mail is already installed, and if it refuses to get installed then you can force the installation as follows.
pear install –alldeps -f Mail
2. If Mail is already installed, then you can install the Net_SMTP option alone as follows.
pear install Net_SMTP
After that, execute the script again and it would work !!!