我在 Codeigniter 控制器中有这个发送邮件代码。
$config['useragent'] = 'CodeIgniter';
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$this->load->library('email');
$this->email->initialize($config);
$this->email->from('mymail@yahoo.com', 'myname');
$this->email->to('testingmail@gmail.com');
$this->email->subject('Email Test');
$this->email->message('Testing .');
$this->email->send();
echo $this->email->print_debugger();
但它显示unable to send email using PHP mail()
。请帮我解决问题。