title: PHP Pear Mail - Include Path
body: <p>I am working on a PHP project that uses PHP's built in mail function. I am adding the option to use Pear mail.</p>
  
  <p>It seems that in most hosting environments, using:</p>
  
  <pre><code>require_once('Mail.php') 
  </code></pre>
  
  <p>doesn't work which is what all of the examples I could find show. Writing the include path as:</p>
  
  <pre><code>require_once('/path/to/pear/Mail.php')
  </code></pre>
  
  <p>also doesn't seem to work. However, setting the include path like:</p>
  
  <pre><code>set_include_path('/path/to/pear/')
  require_once('Mail.php')
  </code></pre>
  
  <p>does work. Because there is a configuration file in my app where this is stored and the config is used in most of my pages (not having to do with email), I am not sure if this is a good idea. My config file now has the values stored like this:</p>
  
  <pre><code>// pear smtp mail settings
  set_include_path('/path/to/pear/');
  define('PEAR_INCLUDE_PATH', 'Mail.php');
  define('SMTP_HOST', 'ssl://smtp.gmail.com');
  define('SMTP_PORT', '465');
  define('SMTP_USER', 'username@gmail.com');
  define('SMTP_PASS', 'password');
  </code></pre>
  
  <p>Is this going to create problems for me? How should I do this?</p>
  
  <p>Thank you</p>