Here’s my send email function that sends the email however i have two different types of emails (txt, html). The problem is that when it sent to my yahoo address it sends the html which is fine BUT it shows the html code instead of rendering it. How can I fix that.
/**
* Send email message of given type (activate, forgot_password, etc.)
*
* @param string
* @param string
* @param array
* @return void
*/
function sendEmail($template, $type, $subject, $userData)
{
$this->ci->load->library('email');
$this->ci->email->from('kowmanagement@kansasoutlawwrestling.com', 'Kansas Outlaw Wrestling');
$this->ci->email->reply_to('kowmanagement@kansasoutlawwrestling.com', 'Kansas Outlaw Wrestling');
$this->ci->email->to($userData['email']);
$this->ci->email->subject($subject);
$this->ci->email->message($this->ci->load->view($template .'/email/'.$type.'-html', $userData, TRUE));
$this->ci->email->set_alt_message($this->ci->load->view($template .'/email/'.$type.'-txt', $userData, TRUE));
$this->ci->email->send();
}
Try PHPMailer, it is powerful and complete.