【发布时间】:2016-01-26 03:12:22
【问题描述】:
我在 CentOS 6 服务器上安装了 sendmail,它似乎运行良好,因为我可以使用 CLI 发送测试消息。
但是,当尝试使用 CodeIgniter 的电子邮件类发送测试消息时,似乎出现了一些问题。我的 email.php 配置是
$config['protocol'] = 'sendmail';
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
用于测试电子邮件的控制器:
$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();
当我通过 CodeIgniter 发送测试消息时,我收到此错误消息
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.
在配置中切换到 SMTP 或邮件时,我仍然收到错误。
有什么建议可以从哪里着手解决这个问题?
【问题讨论】:
-
$this->load->library('email', $config); -
你加载 email.php 配置文件了吗?
-
面临类似问题。获得退出状态 64。无法打开到 Sendmail 的套接字。请检查设置。但适用于 CLI
标签: php codeigniter email centos sendmail