我已经使用了几种方法,但是似乎无法正常工作。我正在实时服务器上运行它。
我正在使用bigrock托管,根据他们的文档,它说仅将“ localhost”用作smtp托管。关联
它说电子邮件已发送,但我什么也没收到。
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' => '[email protected]',
'smtp_pass' => 'sdfsfsdfsd'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]', 'ABC');
$this->email->to('[email protected]');
$this->email->subject('Test');
$this->email->message('Success');
if ($this->email->send()) {
echo 'Email Sent';
} else {
show_error($this->email->print_debugger());
}
}
提前致谢。
这行:$ this-> email-> to('abc @ gmail'); 将其设置为“ [email protected]”,并确保其已存在。如果仍然无法使用,请尝试从您内部的合法电子邮件中发送电子邮件->来自。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句