Installed Mail, Auth_SASL, Net_SMTP and Net_Socket in PHP but still getting an error? Find the directories that have the “Mail” and “Net” folders (installed with your PEAR mail packages, probably above your “public_html” or “www” directory) and set your include path to point to that directory for the duration of your script (it resets at the end back to whatever is in php.ini).  Very useful.

PHP example:

ini_set('include_path', '.:/usr/lib/php:/usr/local/lib/php:/home/[username]/php');
require_once('Mail.php');
...

Just replace [username] with your username or directory name.

PHP’s manual on ini_set and include_path.