这是我的电子邮件发送代码
function send_letter()
{
$config['mailtype'] = 'text or html';
$this->email->initialize($config);
$description = $this->input->post('description',true);
$subject = $this->input->post('subject',true);
$this->load->model('newsletter_model');
$this->data['mail_list'] = $this->newsletter_model->getmaillist();
foreach($this->data['mail_list'] as $val)
{
$this->email->from('dfdf1@gmail.com', 'Imageinit');
$this->email->subject($subject);
$this->email->message($description);
$this->email->set_newline("\r\n");
$this->email->to($val['emailid']);
$this->email->send();
}
$newdata=array('success'=>1);
$this->session->set_userdata($newdata);
$this->index();
}
电子邮件发送成功..但是当我发送html数据时,邮件中也包含html数据
例如..如果我以粗体标签发送数据。它出现粗体标签。不会使文字变粗
答案 0 :(得分:0)
只需将config mailtype替换为html即可。如果您想以html格式发送,请仅使用 html 。默认邮件类型为文本。
$config['mailtype'] = 'html';