title: Codeigniter $this->email->send() not working while mail() does
body: <p>I can't figure out why if I try to use the CI Email Class it doesn't send emails, while if I use the native PHP mail() Class works.</p>
  
  <p>Has to be noted that sometimes I get "email sent" while is not actually sent and sometimes I get the error "my server is not setup".</p>
  
  <p>I tried to figure out how to set it up but... nothing...</p>
  
  <p>Controller code follows:</p>
  
  <pre><code> if($this-&gt;form_validation-&gt;run()){
  
                  //Set Language
                  $this-&gt;lang-&gt;load('site', $this-&gt;session-&gt;userdata('lang'));
  
                  //Random key
                  $user_valid_key = md5(uniqid());
  
                  //Prepare email
                  $this-&gt;load-&gt;library('email', array('mailtype' =&gt; 'html'));
                  $this-&gt;email-&gt;from($this-&gt;config-&gt;item('email_signup_from'), 'Wondermark.net');
                  $this-&gt;email-&gt;to($this-&gt;input-&gt;post('email'));
                  $this-&gt;email-&gt;subject($this-&gt;lang-&gt;line('email_signup_subject'));
  
                  //Format mail con %s per inserire i campi necessari
                  $signup_msg = sprintf($this-&gt;lang-&gt;line('email_signup_message'), $this-&gt;input-&gt;post('fname'), base_url().'main/signup_confirm/'.$user_valid_key);
  
                  $this-&gt;email-&gt;message((string)$signup_msg);
  
                  if($this-&gt;email-&gt;send()){
                      //TODO: load view...
                      echo "email sent";
                  }else{
                      $to = $this-&gt;input-&gt;post('email');
                      mail($to, 'test', 'Other sent option failed');
                      echo $this-&gt;input-&gt;post('email');
                      show_error($this-&gt;email-&gt;print_debugger());
                  }
  
                  //TODO: Add to db
  
              }else{
  
              // Form validation failed
  
  }
  </code></pre>