Sending emails with CodeIgniter getting PHP error
<p>im trying to teach myself codeignighter and currently learning sending emails.</p>

<p>I am trying to load the email library and i keep getting "Undefined property: Email::$load" error.</p>

<p>Ive tried for the last hour to find the problem but cant find out whats wrong, any help is much appreciated.</p>

<p>my <strong>email.php</strong></p>

<pre><code>    &lt;?php
class Email extends CI_Controller
{
    function __construct()
    {
        parent::get_instance();
    }

    function index()
    {
        $config = Array(
            'protocol' =&gt; 'smtp',
            'smtp_host' =&gt; 'ssl://smtp.googlemail.com',
            'smtp_port' =&gt; 465,
            'smtp_user' =&gt; '****s@gmail.com',
            'smtp_pass' =&gt; '******'
        );

        $this-&gt;load-&gt;library('email', $config);

        $this-&gt;email-&gt;set_newline("\r\n");

        $this-&gt;email-&gt;from('****@gmail.com' , 'joe blog');
        $this-&gt;email-&gt;to('****@gmail.com');
        $this-&gt;email-&gt;subject('this is a test');
        $this-&gt;email-&gt;message('it is working .... great!');

        if($this-&gt;email-&gt;send())
        {
            echo 'your email was sent';
        }

        else
        {
            show_error($this-&gt;email-&gt;print_debugger());
        }
    }
}
</code></pre>