CodeIgniter unable to send email using PHP mail()

前端 未结 12 2115
孤街浪徒
孤街浪徒 2020-11-29 06:27

I\'m trying to send an e-mail with Codeigniter like this:

$this->load->library(\'email\');

$this->email->from(\"myemail@email.com\");
$this->         


        
12条回答
  •  失恋的感觉
    2020-11-29 06:43

    Add a protocol variable to the config array and assign it the value "sendmail". The email.php file in the config folder should read as shown below. Mine works like this:

    $config['protocol'] = 'sendmail';
    $config['mailtype'] = 'html';
    $config['charset']  = 'utf-8';
    $config['newline']  = "\r\n";
    

提交回复
热议问题