发送到gmail时,Summernote会将消息转换为html代码

时间:2016-02-18 10:21:28

标签: codeigniter gmail summernote

大家好,我现在一直在做一个夏令营textarea,但是当我把我的电子邮件发送到gmail地址时,当你打开你的收件箱时,它变成了这样的html而不是文本:

& lt;p&g t ;test</p&gt

这是我的控制器代码:

$this->load->library('email'); // load email library
$this->email->set_newline ("\r\n");

$this->email->from($this->session->userdata('user_email'),$this->session-  >userdata('user_firstname').' '.$this->session->userdata('user_lastname'));
$this->email->to(set_value('message_email_to'));
$this->email->subject(set_value('subject'));
$this->email->message(set_value('message'));

if($this->email->send())
{
    $this->Compose_model->insert($data);
    $this->session->set_flashdata('message', 'Create Record Success');
    redirect(BASE_URL.'tenant/compose');
}
else
{
    show_error($this->email->print_debugger());
}

1 个答案:

答案 0 :(得分:0)

Try this

 $this->load->library('email'); 
 $config['charset'] = "utf-8";
 $config['mailtype'] = "html";
 $config['newline'] = "\r\n";
 $this->email->initialize($config);

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">置于您的邮件之上