Error in mail content using SMTP in codeigniter
Actually, my mail is sent with HTML tags and it is showing the HTML tags which is not correct.
As of CodeIgniter 3.x. There are many features added. This example is almost same with earlier versions, but you can do much more.
Follow the link for documentation.
// load email library
$this->load->library('email');
// prepare email
$this->email
->from('info@example.com', 'Example Inc.')
->to('to@example.com')
->subject('Hello from Example Inc.')
->message('Hello, We are Example Inc.')
->set_mailtype('html');
// send email
$this->email->send();
If you have template design. You can also include template in message method like this ...
->message($this->load->view('email_template', $data, true))
Here, the first parameter is email_template.php in your views directory, second parameter the data to be sent to email template, you can set it '' or array() or [] if not passing any dynamic data and last parameter true make sure, you grab the template data instead output.
Hope this is helpful.