【发布时间】:2016-02-02 03:55:43
【问题描述】:
我已经使用了几种方法,但似乎无法使其正常工作。我在实时服务器上运行它。
我正在使用 bigrock 托管,根据他们的文档,它说只需使用“localhost”作为 smtp 主机。 Link
它说电子邮件已发送,但我什么也没收到..
public function index() {
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'localhost',
'smtp_port' => '587',
// Other way it say Email sent
//'smtp_host' => 'ssl://localhost',
//'smtp_port' => '465',
'smtp_user' => 'support@abc.com',
'smtp_pass' => 'sdfsfsdfsd'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('support@abc.com', 'ABC');
$this->email->to('abc@gmail.com');
$this->email->subject('Test');
$this->email->message('Success');
if ($this->email->send()) {
echo 'Email Sent';
} else {
show_error($this->email->print_debugger());
}
}
提前致谢。
【问题讨论】:
标签: php codeigniter codeigniter-3