[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