Welcome Guest, Not a member yet? Register   Sign In
Creating a Library
#1

[eluser]Karlos23[/eluser]
I am currently creating a library (Login_Auth) and I have hit a brick wall. I keep getting the same old error each time!
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined property: Forgot_pass::$email
Filename: libraries/Login_auth.php
Line Number: 144
Fatal error: Call to a member function from() on a non-object in /home/sniko/public_html/YouLoveMe/application/libraries/Login_auth.php on line 144
I don't see where I have gone wrong though, my code is currently and yes I have got the instance CI loaded via my __construct() function.
Code:
public function __construct()
    {
        $this->CI =& get_instance();
        
        log_message('debug', 'Login & Auth Class Initialized');
    }

Now the function.
Code:
public function forgot_pass($user_email)
    {
        if ($user_email == '')
        {
            return false;
        }
        
        if (!$this->CI->config->load('email'))
        {
            $this->CI->email->initialize($this->email);
        }
        
        $this->CI->email->from($email['name'], $email['address']);
        $this->CI->email->to($user_email);
        $this->CI->email->subject('Forgotten Password');
        $this->CI->email->message('');
        
        
        if ($this->CI->email->send())
        {
            return true;
        }
        
        return false;
    }

Any help? Thanks


Messages In This Thread
Creating a Library - by El Forum - 04-22-2010, 02:06 AM
Creating a Library - by El Forum - 04-22-2010, 02:42 AM
Creating a Library - by El Forum - 04-22-2010, 10:02 AM
Creating a Library - by El Forum - 04-24-2010, 05:58 AM
Creating a Library - by El Forum - 04-24-2010, 12:56 PM
Creating a Library - by El Forum - 04-24-2010, 02:34 PM
Creating a Library - by El Forum - 04-24-2010, 03:56 PM
Creating a Library - by El Forum - 04-25-2010, 03:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB