php - Codeigniter email class not working
I tried the code below. At one time the code was working fine. I was able to send the emails. After a few minutes, when I tried it again without even changing anything, I get this error messageUnable to send email using PHP mail(). Your server might not be configured to send mail using this method.
I dont know whats wrong. Lately I am facing a lot of similar bugs with codeigniter.
public function email($message = NULL, $subject=NULL, $email=NULL){
if(!isset($email)){
$to = $this->session->userdata('email');
}else{
$to = $email;
}
$this->load->library('email');
$this->email->from('[email protected]', 'Mydomain');
$this->email->to($to);
$this->email->subject($subject);
$this->email->message($message);
$this->email->send();
}
Answer
Solution:
i face this problem and work hard and i find solution this
just little change in email config its working 100%
Answer
Solution:
I added the following lines and the mail is working again.