04-05-2018, 08:00 AM
Please help...
I have 2 controllers
first controller is home
and my sendemail method is working and no problem at all but when I copy the same method to user controller it keeps me getting an error "Message: Call to a member function email->from() on string" heres my method...
public function sendEmail($email,$link){
$message = "Hi"
$subject = "hello message";
$this->load->library('email');
$this->load->helper(array('email'));
$this->email->from('[email protected]', 'Email');
$this->email->to($email);
$this->email->subject($subject);
$this->email->message($message);
$this->email->set_mailtype("html");
if($this->email->send())
return true;
else
return false;
}
I am looking forward to your positive response thank you so much...
I have 2 controllers
first controller is home
and my sendemail method is working and no problem at all but when I copy the same method to user controller it keeps me getting an error "Message: Call to a member function email->from() on string" heres my method...
public function sendEmail($email,$link){
$message = "Hi"
$subject = "hello message";
$this->load->library('email');
$this->load->helper(array('email'));
$this->email->from('[email protected]', 'Email');
$this->email->to($email);
$this->email->subject($subject);
$this->email->message($message);
$this->email->set_mailtype("html");
if($this->email->send())
return true;
else
return false;
}
I am looking forward to your positive response thank you so much...