title: Integration PHP PEAR MAIL in codeigniter
body: <p>I've set up successfully the pear integration in codeigniter following the tutorial here:</p>
  
  <blockquote>
    <p><a href="http://codeigniter.com/wiki/PEAR_integration/" rel="nofollow">http://codeigniter.com/wiki/PEAR_integration/</a></p>
  </blockquote>
  
  <p>I would like to use the package Mail:</p>
  
  <blockquote>
    <p><a href="http://pear.php.net/package/Mail/" rel="nofollow">http://pear.php.net/package/Mail/</a></p>
  </blockquote>
  
  <p>I've install it in system/application/pear with all dependences (Net/SMTP, Net/Socket, Auth/SASL)</p>
  
  <p>When I call it ($this->pearloader->load('Mail','mail');) I got the following error:</p>
  
  <blockquote>
    <p>Fatal error:
    Pearloader::require_once()
    [function.require]: Failed opening
    required 'Mail/mail.php'
    (include_path='.:/usr/share/php:/usr/share/pear:/var/www/mywebsite/system/application/pear/')
    in
    /var/www/mywebsite/system/application/libraries/Pearloader.php
    on line 6</p>
  </blockquote>
  
  <p>The Mail/mail.php is in fact in Mail/Mail/mail.php in the package Mail from PEAR.
  If I put the mail.php in the upper folder or if I change the pearloader.php to include the path I got the following error:</p>
  
  <blockquote>
    <p>Fatal error: Class 'Mail' not found in
    /var/www/mywebsite/system/application/pear/Mail/mail.php
    on line 51</p>
  </blockquote>
  
  <p>If I add include_once("Mail.php"); in the mail.php (that I let in the correct path like I said before) it solve the problem but it doesn't sound to me a proper solution.</p>
  
  <p>I don't manage to figure out how I could solve it in "an elegant way". Like I could like to don't have to touch file from the PEAR packages and I want to use pear inside my application.</p>
  
  <p>Is there any geek out there :) who already had this problem and found the a better way to solve it?</p>