php - CodeIgniter generates error when sending email -


i amusing code below send email using codeigniter keep getting error

unable send email using php mail(). server might not configured send mail using method.

        $this->email->from("kariuki.john@gmail.com", "name");         $this->email->to('johnkariukin@gmail.com');         $this->email->cc('contact@johnkariuki.co.ke');         $this->email->subject("new email on johnkariuki.co.ke");         $this->email->message("abdfdfj\nfdgdfgdf");          if($this->email->send())         {             echo "works";          } else {              $this->email->print_debugger();           } 

what issue? cannot find working solution online. issue? cannot find working solution online. have loaded email library in constructor

by default, email protocol set 'mail', may need switch 'sendmail' instead.

$config['protocol'] = 'sendmail'; $this->email->initialize($config); 

this require install sendmail on server (sudo apt-get install sendmail if you're on ubuntu).

$this->email->send() uses php's builtin mail() function, , according this post may trying use sendmail if protocol isn't explicitly set 'sendmail'.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -