I have sendmail installed on a CentOS 6 server that seems to work well given that I can send a test message using CLI.
However, when trying to send a test message using CodeIgniter's email class, there seems to be some problem. My email.php config is
$config['protocol'] = 'sendmail';
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['newline'] = "
";
The controller for testing email:
$this->load->library('email');
$this->email->from('your@example.com', 'from name');
$this->email->to('someone@somewhere.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();
When I send the test message through CodeIgniter, I get this error message
Exit status code: 71
Unable to open a socket to Sendmail. Please check settings.
Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method.
When switching to SMTP or mail in the config I still get errors.
Any suggestions where to start trying to troubleshoot this problem?