【发布时间】:2017-01-06 20:14:02
【问题描述】:
我无法在主机 (https://www.namecheap.com) 上发送电子邮件。使用CodeIgniter 框架
$config = Array(
'protocol' => 'HTTP',// also used smtp
'smtp_host' => 'mail.sss.com.ng',
'smtp_port' => 26,
'smtp_user' => 'ss@sss.com.ng', // change it to yours
'smtp_pass' => '3333333', // change it to yours
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('sss@sss.com.ng'); // change it to yours
$this->email->to($to);// change it to yours
$this->email->subject($subject);
$this->email->message('6666');
if($this->email->send())
{
echo 'Email sent.';
}
else
{
show_error($this->email->print_debugger());
}
}
我收到此错误:
error 遇到错误
无法使用 PHP mail() 发送电子邮件。您的服务器可能不是 配置为使用此方法发送邮件。
用户代理:CodeIgniter
【问题讨论】:
标签: php codeigniter