This is my email sending code
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();
}
Email sends successfully..but when i send html data mail also contains html data
eg..if i sent data in bold tag .it appears bold tag.doesn’t makes the text bold
Just replace the config mailtype to html. If you want to send as html then use only html. The default mailtype is text.
Email Library config in codeigniter