title: PHP Pear Mail Returns Fatal Error: Failed opening required 'Mail.php'
body: <p>How to include mail.php for using PHP Pear Mail. I'm using the following code in test.php file:</p>
  
  <pre><code>    require_once "Mail.php";
  
      $from = "&lt;test@gmail.com&gt;";
      $to = "&lt;testing@gmail.com&gt;";
      $subject = "Hi!";
      $body = "Hi,\n\nHow are you?";
  
      $host = "ssl://smtp.gmail.com";
      $port = "465";
      $username = "&lt;testtest@gmail.com&gt;";
      $password = "testtest";
  
      $headers = array ('From' =&gt; $from,
        'To' =&gt; $to,
        'Subject' =&gt; $subject);
      $smtp = Mail::factory('smtp',
        array ('host' =&gt; $host,
          'port' =&gt; $port,
          'auth' =&gt; true,
          'username' =&gt; $username,
          'password' =&gt; $password));
  
      $mail = $smtp-&gt;send($to, $headers, $body);
  
      if (PEAR::isError($mail)) {
        echo("&lt;p&gt;" . $mail-&gt;getMessage() . "&lt;/p&gt;");
      } else {
        echo("&lt;p&gt;Message successfully sent!&lt;/p&gt;");
      }
  </code></pre>
  
  <p>and the following error is encountered via this code:</p>
  
  <pre><code>  Warning: require_once(Mail.php) [function.require-once]: failed to open stream: No such file or directory in D:\Hosting\6525150\html\test.php on line 3
  
    Fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='.;C:\php5\pear') in D:\Hosting\6525150\html\test.php on line 3
  </code></pre>
  
  <p>Can someone tell me what is the problem?</p>