这是我发送HTML电子邮件的代码,但无法正常工作。电子邮件中仅显示原始的html代码。
$emailID = $this->input->post('email');
$name = $this->input->post('name');
$this->load->library('email');
$config['protocol'] = 'smtp';
$config['mailtype'] = 'html';
$config['crlf'] = "\r\n";
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";
$config['validate'] = FALSE;
$this->email->set_newline("\r\n");
$this->email->from($emailID,$name);
$this->email->to('[email protected]');
$this->email->subject('Email Testing');
$this->email->message('from clientside mail');
$this->email->send();
$message = $this->load->view('emailfile/file','',TRUE);
$this->load->library('email', $config);
$this->email->from($emailID,$name);
$this->email->to($emailID,$name);
$this->email->subject('Email Testing');
$this->email->message($message);
$this->email->send();
//echo $this->email->print_debugger();
新增$this->email->initialize($config);
:
$this->load->library('email');
$config['protocol'] = 'smtp';
$config['mailtype'] = 'html';
$config['crlf'] = "\r\n";
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";
$config['validate'] = FALSE;
$this->email->initialize($config);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句