我是Codeigniter中的电子邮件新手
我的控制者:
class Email extends CI_Controller
{
public function __construct()
{
parent::__construct();
}
function index()
{
$config = array('protocol' => 'smpt',
'smtp_host' => 'belphegor.in-hell.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'blabla',
);
$this->load->library('email',$config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]', 'My Blabla');
$this->email->to('[email protected]');
$this->email->subject('Just test');
$this->email->message('qwe adlw is alqopl slaod');
if ($this->email->send()) {
echo "email send";
} else {
show_error($this->email->debugger());
}
}
}
当我运行代码时,它会显示“电子邮件发送”,但是当我检查服务器时,根本不存在外发电子邮件。当我登录到yahoo([email protected])时,没有电子邮件输入。我该如何解决?
协议密钥的配置数组上有一个错误。
尝试从以下更改:
$config = array('protocol' => 'smpt',
'smtp_host' => 'belphegor.in-hell.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'blabla',
);
到 :
$config = array('protocol' => 'smtp',
'smtp_host' => 'belphegor.in-hell.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'blabla',
);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句