title: Codeigniter email class not working
body: <p>I tried the code below. At one time the code was working fine. I was able to send the emails. After a few minutes, when I tried it again without even changing anything, I get this error message <code>Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.</code></p>
  
  <p>I dont know whats wrong. Lately I am facing a lot of similar bugs with codeigniter. </p>
  
  <pre><code>public function email($message = NULL, $subject=NULL, $email=NULL){
          if(!isset($email)){
              $to = $this-&gt;session-&gt;userdata('email');
          }else{
              $to = $email;
          }
          $this-&gt;load-&gt;library('email');
  
  
          $this-&gt;email-&gt;from('noreply@mydomain.com', 'Mydomain');
          $this-&gt;email-&gt;to($to); 
  
          $this-&gt;email-&gt;subject($subject);
          $this-&gt;email-&gt;message($message);    
  
          $this-&gt;email-&gt;send();
      }
  </code></pre>