我已经使用了几种方法,但似乎无法让它工作。我正在实时服务器上运行它。
我正在使用 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' => '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f685838686998482b6979495d895999b" rel="noreferrer noopener nofollow">[email protected]</a>',
'smtp_pass' => 'sdfsfsdfsd'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8bf8fefbfbe4f9ffcbeae9e8a5e8e4e6" rel="noreferrer noopener nofollow">[email protected]</a>', 'ABC');
$this->email->to('<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="adcccfceedcac0ccc4c183cec2c0" rel="noreferrer noopener nofollow">[email protected]</a>');
$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->from 中发送合法的电子邮件。
关于php - 使用 Codeigniter 发送电子邮件时说电子邮件已发送,但没有收到任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35144765/